How to ensure paths are set during boot
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?
I edited /etc/profile and added "pathmunge /sbin", so the end of the /etc/profile file looks like this:
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.
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 02:01 AM.|