-   Linux - Newbie (
-   -   How to ensure paths are set during boot (

greengrocer 04-13-2007 10:37 PM

How to ensure paths are set during boot
Hello all,

Using Fedora Core 6 at present, but I suppose the answer to this question will apply to many distros.

How does one configure 'paths' so that the desired 'paths' are configured during the boot process?

For instance, when I am root, I always have to type '/sbin/ifconfig' which is annoying. I would like to just type 'ifconfig'

So how do I set /sbin as a default 'path' for linux to look into for the commands I type, during boot up?


greengrocer 04-13-2007 11:19 PM

I edited /etc/profile and added "pathmunge /sbin", so the end of the /etc/profile file looks like this:


 pathmunge /sbin
unset i
unset pathmunge

It solved my immediate frustration, but I am wondering if this is good practice?


AwesomeMachine 04-14-2007 12:41 AM

With a few exceptions all the commands in /sbin must be run as root. Ifconfig happens to have one function that can be run as user: Ifconfig with no parameters gives interface info. If there is a program you want to run as user, but it isn't in the user's PATH you do this:

#ifconfig file for normal users

in a text editor. Make it exectutable:

chmod a+x <filenameofscript>

and then, from whatever directory the file is in:


will run /sbin/ifconfig.

Electro 04-14-2007 01:47 AM

The easiest is to add the following line to /root/.bashrc or /root/.profile.


If you use su - to substitute user for root, then you will not be in this problem. Both Redhat and Fedora have the same issue.

All times are GMT -5. The time now is 01:41 AM.