1837090 Members
2238 Online
110112 Solutions
New Discussion

PATH and MANPATH

 
SOLVED
Go to solution
Ron Bromwell
Frequent Advisor

PATH and MANPATH

Hi All,
I'm trying to find out more information about the PATH and MANPATH files in /etc. Mainly, can I add directly to the file and if not, how do I add to it. Any info would be very helpful.
Thanks,
Ron
life's a journey, not a destination
9 REPLIES 9
Sanjay_6
Honored Contributor

Re: PATH and MANPATH

Hi Ron,

It is preferable to do any changes to the local .profile file in $HOME. To make any change just add these lines at the bootom of $HOME/.profile

export PATH=$PATH:/add_new_path
export MANPATH+$MANPTH:/add_mew_man_path

Hope this helps.

Regds
harry d brown jr
Honored Contributor

Re: PATH and MANPATH

The MANPATH as Sanjay has posted should have an "=" not a "+" - just a typo.

live free or die
harry
Live Free or Die
Daimian Woznick
Trusted Contributor

Re: PATH and MANPATH

To add on to the above, the two files are used for system default settings. Changes will affect all the users on the system.
Daimian Woznick
Trusted Contributor

Re: PATH and MANPATH

This is how the files are used:

MANPATH=`cat /etc/MANPATH`
PATH=`cat /etc/PATH`

Hope this helps.
Rich Wright
Trusted Contributor

Re: PATH and MANPATH

It is more risky, but you can make a backup copy and edit the files directly. Software installs do this sometimes.

If you only need the changes for a given user or group of users, then the above methods would be perfered.
PIYUSH D. PATEL
Honored Contributor

Re: PATH and MANPATH

Hi,

You can set the PATH and MANPATH in the .profile of the user.

export MANPATH=$MANPATH:/new-dir
export PATH=$PATH:/new-dir

Piyush
Darrell Allen
Honored Contributor
Solution

Re: PATH and MANPATH

Hi Ron,

Yes, you (or rather the superuser) can directly edit PATH and MANPATH. Simply use your favorite file editor (vi or whatever).

Since these are generally sourced by everyone logging into the system, you should only add paths that you want everyone to have. Otherwise, add the changes suggested to individuals' .profile files.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
James R. Ferguson
Acclaimed Contributor

Re: PATH and MANPATH

Hi Ron:

Remember to keep frequently accessed directories in the front of the list for the fastest performance (access). Remember too, *never* to place "." in the PATH -- that's a classic invitation to trojan aliases.

It is much better to customize individual user's profiles if they are the only few who need additional pathes than to globally overload every user via /etc/profile (or via /etc/PATH and /etc/MANPATH (see '/etc/profile' itself).

Regards!

...JRF...
Sanjay_6
Honored Contributor

Re: PATH and MANPATH

Harry,

Thanks for correcting my typo error.

Thanks once again.

Regards
Sanjay