7/26/2019

MAC Terminal Commands are no longer working [SOLVED]

The problem started when I was trying to install Visual Studio Code and I was trying to add the path below inside my bash profile so I can easily launch Visual Studio Code using the command "code .".

export PATH="\$PATH:/Applications/Visual Studio Code.app/Contents/Resources/app/bin"

After saving it and relaunched my terminal, everything went wrong. I can no longer do the "ls", "bash", "sudo", "nano", and so on. The only command that was available to me was "cd" and that was it. I went panic for a minute because I am not sure how to edit the bash profile anymore now that all the commands are no longer found.

I went to the folder where the bash profile is located via "Finder" by:

1. opening Finder

2. click Go option from the top menu

3. click Go to Folder from the drop down menu

4. in the box type in "~/"

5. click the button "Go".

The bash profile file is hidden so we need to find a way to display it. Most guides online will teach you how to show hidden files via terminal but we do not have that option right now due to our terminal commands are not working so another way to display hidden files is by keyboard command.

CMD (command) + SHIFT + . (dot)

Once you press these keys all together, the bash profile file will show.



So opened it via text editor and remove the export path I added earlier, restarted my terminal and everything is back to normal.