Problems with $PATH

1 reply [Last post]
rsubr2
User offline. Last seen 6 years 25 weeks ago. Offline
Joined: 11/21/2011

I was accidentally in the ~/scripts/ folder when attempting to edit .bash_profile. When I went to the home directory and then tried:

 export PATH="$PATH:$HOME/scripts"

I was unable to add the scripts folder to the path. How do I correct this problem? I thought about removing the .bash_profile, but I was worried I would make a huge mistake. Thanks.

Steve
User offline. Last seen 4 years 7 weeks ago. Offline
Joined: 08/15/2010
bash profile in wrong location

No problem. You can just move the profile into the correct directory. First check if you already have a .bash_profile (remember the period at the front):

cat ~/.bash_profile

If it says "no such file or directory", then you are clear to move the file:

mv ~/scripts/.bash_profile ~/

(By specifying only the destination directory (~/) but no file name, it will use the existing file name...)

Once you do that, open a new terminal window (so your profile is "executed") and you should be good to go!