Mac Terminal Not Remembering Command

Hello Everyone,

I’m going through the git tutorial form udacity and I’m trying to launch Sublime 3 from my mac terminal. I have created the directory called .bash_profile and added the line “export PATH=$PATH:/Applications/Sublime\”. Afterwards I type in subl and it launches sublime from the terminal but when I close and open the terminal again it doesn’t remember the subl command. After entering subl, it just says subl command not found. Can anyone help me find out what’s wrong? Thanks!

I’m sure you meant you created a file instead of a directory, but I want to make sure you didn’t actually create a directory called .bash_profile. It should be a file, with no extension, and it should be in your home directory. If you’d like to start fresh, try copying and pasting these commands

rm -rf ~/.bash_profile
touch ~/.bash_profile
echo "export PATH=\$PATH:/Applications/Sublime\" >> ~/.bash_profile

Thanks for taking the time to reply! Do you happen to know the next steps to launch sublime from the terminal?

No need to touch it, btw.

It’s the same as before.

Try this.

This helped a lot. Thanks.

Hello there, pls how can I reset my terminal. The commands are not working. Helpppppp

What do you mean? What have you been doing? Which commands aren’t working? Which OS are you using? Which terminal emulator?

Hi, I use macOS Sierra. Every command I type in returns not found. I know I have some how missed up with the bash profile. Is there a way I can fix this

Try moving your bash profile to see if that fixes the problem.

mv ~/.bash_profile ~/.bash_profile.bak

Restart your terminal after running this.

1 Like

thanks , it’s work for me