Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-02-2009, 05:08 PM
|
#1
|
LQ Newbie
Registered: Sep 2009
Posts: 14
Rep:
|
Shell path and evironment path
Hello
I am a bit confused about what environment PATH means. Is it just another name for PATH?
If i want to add a directory to my existing shell path, do i have to edit the shell .login files or can i do it while logged on?
Thanks for your time
|
|
|
12-02-2009, 05:15 PM
|
#2
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
$PATH is part of your environment----it is one of the "environment variables". Enter "env" to see them all.
You can change $PATH at any time like so:
(add /opt/stuff to PATH)
Code:
export PATH="$PATH:/opt/stuff"
To make it permanent, you have to edit whatever startup script sets the final PATH. This differs between distros.
|
|
|
12-02-2009, 05:24 PM
|
#3
|
LQ Newbie
Registered: Sep 2009
Posts: 14
Original Poster
Rep:
|
When i use the command to add a directory to my PATH, do i need to do anything to change my environment PATH or is the only way to do that by making it permanent in the start up files?
Also there is another path it is lower case, on my linux box it has the same values as the uppercase PATH , are these the same? (i ask because unix is usually case sensetive on everything)
Thank you!
|
|
|
12-02-2009, 06:00 PM
|
#4
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,440
|
As Pixellany said, you can change it interactively any time for it to have immediate effect, but you must change the login file eg .bashrc or .bash_profile, for it to survive logging out and/or a reboot.
I've never seen a lowercase version; which distro/version and shell are you using?
|
|
|
12-02-2009, 09:01 PM
|
#5
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
"PATH" and "environment PATH" are the same thing---PATH is simply one of the environment variables.
The PATH variable gets set during system startup--that's why a permanent change needs to go in a startup file somewhere.
|
|
|
12-02-2009, 09:17 PM
|
#6
|
LQ Guru
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726
|
Quote:
Originally Posted by chrism01
I've never seen a lowercase version; which distro/version and shell are you using?
|
Hmm, lowercase $path, I have vague memories of that from tcsh.
Cheers,
Evo2.
|
|
|
All times are GMT -5. The time now is 10:32 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|