I was trying to add JAVA_HOME in the path variable.
I downloaded Java JDK and done following:
nano ~/.bash_profileadded following lines and saved the file:
export JAVA_HOME=$(/usr/libexec/java_home) export PATH=$JAVA_HOME/bin=$PATHsource ~/.bash_profile
After that I tried to open bash file again using:
nano ~/.bash_profile
It shows:
-bash: nano: command not found
I tried other commands too such as brew doctor, curl, vim, java -version etc. All of them shows command not found error.
What is the solution for this? How can I restore my system?
Updated: Solution that I used:
I run the following commands to set the standard default path that Mac OS uses in the command line:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"