Home > Archive > Linux/Unix > December 2003 > $path





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author $path
mindmesh

2003-12-15, 12:44 pm

How do you permanently edit $PATH ?
Papiya

2003-12-15, 12:49 pm

# vi /etc/profile
Boulware5

2003-12-15, 1:02 pm

quote:
Originally posted by mindmesh
How do you permanently edit $PATH ?


If you do it in /etc/profile it will be global (for all users). You can put it in .bashrc for just you. Add something like this:

PATH=$PATH:/sbin:..... <-- add your path here, separate by ":"
mindmesh

2003-12-15, 1:02 pm

Thanks guys. I appreciate the help. I'll be buggin you guys again soon.
Papiya

2003-12-15, 2:23 pm

quote:
Originally posted by Boulware5
If you do it in /etc/profile it will be global (for all users). You can put it in .bashrc for just you. Add something like this:

PATH=$PATH:/sbin:..... <-- add your path here, separate by ":"



Don't forget to "export" the variable if you want it to be available to all subshells.
mindmesh

2003-12-15, 3:06 pm

quote:
Originally posted by Papiya
Don't forget to "export" the variable if you want it to be available to all subshells.


initially I used:

export PATH=$PATH=/sbin:/usr/sbin:/usr/local/sbin:/usr/X11R6/bin:/root/bin

but it didn't stick after I logged out. Should I have put this command in the .bashrc itself rather then typing it at the command line?
Boulware5

2003-12-15, 3:43 pm

quote:
Originally posted by mindmesh
initially I used:

export PATH=$PATH=/sbin:/usr/sbin:/usr/local/sbin:/usr/X11R6/bin:/root/bin

but it didn't stick after I logged out. Should I have put this command in the .bashrc itself rather then typing it at the command line?



If you don't put it in a startup file, it will only be good for that session. When you log out it will be gone.
mindmesh

2003-12-15, 3:53 pm

Thats what I thought.. Works great now. Thanks again.
Sponsored Links





Free Braindumps | MCSE braindumps software forum

Copyright 2003 - 2008 examnotes.net