By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,818 Members | 1,262 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,818 IT Pros & Developers. It's quick & easy.

Trying to add locations to the PATH

jimpy
P: 7
Greetings,

When I open a terminal and enter :"echo $PATH", I receive this printout:
james@james-desktop:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
I successfully add :
PATH=$PATH:/home/james
james@james-desktop:~$ PATH=$PATH/home/james
james@james-desktop:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games/home/james
But when I close the terminal, and later reopen and check the path, the addition has disappeared. The path is back to the original path, sans the "/home/james".

What way exists to save the change permanently?
Mar 19 '08 #1
Share this Question
Share on Google+
5 Replies


micmast
100+
P: 144
open a terminal
$> cd ~
$> pico .profile
or use vi whatever you prefer

at the bottom it says someabout paths
just add the
PATH=/your/dir:$PATH

reboot, that should work
Mar 19 '08 #2

jimpy
P: 7
Thank you for the reply, micmast.

I tried your suggestion but only got a "Command not found" message.

On a hunch, I tried just "pico" but that didn't prove fruitful either.

Oh well, it will come, I suppose, one of these days.

Again, thanks for answering.
Mar 19 '08 #3

jlm699
100+
P: 314
I tried just "pico" but that didn't prove fruitful either.
pico is a text editor... so really you can use whatever your favorite one (if you have one already).

It's strange that you don't have pico, either that or pico's not installed in the default location and/or the PATH doesn't point to it.

My favorite editor is vim... so the command he suggested would be like:
Expand|Select|Wrap|Line Numbers
  1. cd ~
  2. vi .profile
  3.  
So the pico, vi, etc is simply the program opening the file .profile (the . means that it is a hidden file so it won't appear on an ls unless you add the -a option [ls -a], which is like saying "list all files" (try ls --help for more info or check your man pages) ).

Anyway, back on topic.... so if you have any text editor, be it emacs, vi, pico and the command "<favorite text editor here> ~/.profile" doesn't work, you could open the GUI version and use the File -> Open method to find/create your ~/.profile file

sorry if any of that went over your head; I know learning Linux can be a daunting task, but there's plenty of documentation out there and forums for guidance like this one (however I might suggest swapping to the System Administration -> Linux / Unix / BSD forum if you have more questions about Linux in general and not Python).
Mar 19 '08 #4

Expert 100+
P: 849
Linux installs of, say, Ubuntu use GNU nano rather than UW pico. It's basically the same thing, but...so with nano, you'd use 'nano .profile' from your home folder to access this.
Mar 19 '08 #5

jimpy
P: 7
jim699 ..

With your help I did finally got to and modified .profile.

Thanks a lot for your explanations.
Mar 19 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.