System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

where is the file "PATH" avaliable in linux

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

where is the file "PATH" avaliable in linux

Hi

In HP-UX we can find the file /etc/PATH, where all PATHS are stored.

like this, what is the file used for Redhat and suse linux
4 REPLIES
Steven Schweda
Honored Contributor

Re: where is the file "PATH" avaliable in linux

> [...] where all PATHS are stored.

"all PATHS"? Really? Have you looked at
/etc/profile (or /etc/csh.login) on an HP-UX
system?

> [...] what is the file used for Redhat and
> suse linux

Look at _their_ shell start-up files? I know
nothing, but I wouldn't expect to find a file
like /etc/PATH used elsewhere.
Steven E. Protter
Exalted Contributor
Solution

Re: where is the file "PATH" avaliable in linux

Shalom,

Where its stored is not important. It is set in the user environment. /etc/profile .bash_profile

It is manipulated everywhere.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Avinash20
Honored Contributor

Re: where is the file "PATH" avaliable in linux

Adding to a Single User's Path

To add a directory to the path of a single user, place the lines in that user's .bash_profile file. Typically, .bash_profile already contains changes to the $PATH variable and also contains an export statement, so you can simply add the desired directory to the end or beginning of the existing statement that changes the $PATH variable. However, if .bash_profile doesn't contain the path changing code, simply add the following two lines to the end of the .bash_profile file:

PATH=$PATH:/data/myscripts
export PATH

Adding to All Users' Paths (except root)

You globally set a path in /etc/profile. That setting is global for all users except user root. Typical /etc/profile files extensively modify the $PATH variable, and then export that variable. What that means is you can modify the path by appending or prepending the desired directory(s) in existing statements modifying the path. Or, you can add your own path modification statements anywhere before the existing export statement. In the very unlikely event that there are no path modification or export statements in /etc/profile, you can insert the following 2 lines of code at the bottom of /etc/profile:

PATH=$PATH:/data/myscripts
export PATH

Adding to the Path of User root
User root is a special case, at least on Mandrake systems. Unlike other users, root is not affected by the path settings in /etc/profile. The reason is simple enough. User root's path is set from scratch by its .bash_profile script. In order to add to the path of user root, modify its .bash_profile.
"Light travels faster than sound. That's why some people appear bright until you hear them speak."
Avinash20
Honored Contributor

Re: where is the file "PATH" avaliable in linux

Hope this link also would be helpful
http://www.linuxheadquarters.com/howto/basic/path.shtml
"Light travels faster than sound. That's why some people appear bright until you hear them speak."