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

P: 7

When I open a terminal and enter :"echo $PATH", I receive this printout:
james@james-desktop:~$ echo $PATH
I successfully add :
james@james-desktop:~$ PATH=$PATH/home/james
james@james-desktop:~$ echo $PATH
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

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

at the bottom it says someabout paths
just add the

reboot, that should work
Mar 19 '08 #2

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

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
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, with nano, you'd use 'nano .profile' from your home folder to access this.
Mar 19 '08 #5

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.