LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 12-02-2009, 05:08 PM   #1
Dopamine
LQ Newbie
 
Registered: Sep 2009
Posts: 14

Rep: Reputation: 0
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
 
Old 12-02-2009, 05:15 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
$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.
 
Old 12-02-2009, 05:24 PM   #3
Dopamine
LQ Newbie
 
Registered: Sep 2009
Posts: 14

Original Poster
Rep: Reputation: 0
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!
 
Old 12-02-2009, 06:00 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,236

Rep: Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710Reputation: 2710
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?
 
Old 12-02-2009, 09:01 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
"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.
 
Old 12-02-2009, 09:17 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,695

Rep: Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698Reputation: 1698
Quote:
Originally Posted by chrism01 View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash script path issue - how to pass a path as a string to a variable PiNPOiNT Programming 5 04-17-2009 05:48 PM
set up java_home path in /home/user/.bashrc but use path in /usr/lib/java vitalstrike82 Slackware 4 01-13-2009 11:25 PM
Shell: tr can only be used when given full path (despite being in $PATH) chochem Programming 2 06-27-2008 08:37 AM
script to change unix path to windows path in all files csross Programming 8 04-29-2006 01:05 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 06:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration