Set PATH in Terminal OS X 10.11.3 – Step-by-Step

command linemacospath

I need to set path /usr/local/gnupg-2.1/bin to the command line.

I tried to enter "export PATH=/usr/local/gnupg-2.1/bin:$PATH" in the command line, but it works until the terminal session ends.

I tried to create .bash_profile, but I don't know how to create hidden file, where to put it, and what it should contain?

Best Answer

Open your terminal an paste de following command:

echo "export PATH=/usr/local/gnupg-2.1/bin:$PATH" >> ~/.bash_profile

This will create the file .bash_profile if does not exists and append your command at the end if the file exists.

To create a hidden file you just need to prepend a dot (.) in the file name when you save it (profile -> .profile). That's all you need.

Related Question