adding a directory to PATH
Hi,
i'm trying to add my scripts directory to my path. I've done it before for my current session (though I cant remember how I did it...) but I wont to do it permanently. I did some research, and I should be looking for the .bash_profile file, but I cant seem to find it in my BT. I also looked at several other files, nothing had "PATH=$PATH" in it.
can anyone give me some guidance?
Re: adding a directory to PATH
.bash_profile should be in /root
if you run ls -la it should be there.
Re: adding a directory to PATH
I think the file you are looking for is /root/.bashrc.
I added:
Code:
PATH="$HOME/Desktop/Scripts:$PATH"
You can also use this file to do other useful things such as adjusting HISTFILESIZE, adding your own aliases etc
Re: adding a directory to PATH
VulpiArgenti is correct, bash_profile was not there, but .bashrc was, and the relevant section was there. Any idea why our version use bshrc, whereas the general rule is bash_profile?
Re: adding a directory to PATH
As this was asked in the "Beginner's Section",it may be worthwhile for future readers running into this and reading the thread; rather than a more direct attempt to answer your more Bt specific question. Still very much worth understanding and a pretty nicely done writeup
http://www.linuxfromscratch.org/blfs...s/profile.html
Re: adding a directory to PATH
It's a minor style/syntax thing but most Linux fanboi's would say that:
Code:
PATH="$PATH:$HOME/Desktop/Scripts"
Is the preferred way of doing things. So that the "new" or "non-standard" things are added to the end of PATH not to the start of it. Also in this specific example it makes it more obvious that you're expanding upon PATH not HOME.