LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 06: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, 06:15 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
$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, 06: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, 07:00 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
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, 10:01 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
"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, 10:17 PM   #6
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
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 06:48 PM
set up java_home path in /home/user/.bashrc but use path in /usr/lib/java vitalstrike82 Slackware 4 01-14-2009 12:25 AM
Shell: tr can only be used when given full path (despite being in $PATH) chochem Programming 2 06-27-2008 09:37 AM
script to change unix path to windows path in all files csross Programming 8 04-29-2006 02:05 PM
How to Chnage Python's module search path (sys.path)? lramos85 Linux - Software 1 05-02-2004 07:10 PM


All times are GMT -5. The time now is 10:05 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration