PDA

View Full Version : How to add a directory to the $PATH on Terminal?




SBR210
Sep 13, 2010, 04:26 AM
I've just created a new directory but when I attempt to run programs from the Terminal it won't work because the new directory is not in my $PATH. Can anyone tell me the simplest way to add a directory to the path without messing up any of the existing settings?

Thanks.



4np
Sep 13, 2010, 04:27 AM
export PATH=/new/path1:/new/path2:$PATH

if you want it to stick, put it in your .profile (~/.profile that is) ... :)

Cromulent
Sep 13, 2010, 04:29 AM
export PATH=/new/path1:/new/path2:$PATH

if you want it to stick, put it in your .profile (~/.profile that is) ... :)

Assuming of course you are using BASH or the Bourne Shell.

4np
Sep 13, 2010, 04:30 AM
true ;) But as BASH is the most common shell, I bet that's the case :)