LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   connecting /sbin/ifconfig to bash command ifconfig (https://www.linuxquestions.org/questions/fedora-35/connecting-sbin-ifconfig-to-bash-command-ifconfig-382200/)

flammable2 11-11-2005 01:56 PM

connecting /sbin/ifconfig to bash command ifconfig
 
I recently installed fedora 4 and unlike previous linux distro's, the /sbin/ scripts havnt been connected to the bash by the normal keywords. I realise there must be some sort of file where you can set these to connect.

Could somebody please tell me how to connect these commands to the single command instead of having to type /sbin/ infront of them?

Thank you! :)

MensaWater 11-11-2005 02:00 PM

They're not "connected". They are "searched". You specify where to search with the PATH variable.

Have a look at /etc/profile and your user's .profile to see what PATH is being set to.

Should be something along the lines of:

PATH=/bin:/sbin:/usr/bin (etc...)
export PATH

(or export PATH=... as a shortcut)

Basically you just add each directory to search delimited by colon (:). They will be searched in the order they appear.

flammable2 11-11-2005 03:06 PM

Thank you, great reply! Will helped me alot!

al2k 11-11-2005 03:19 PM

Not sure if this will help, but I recently just installed Fedora Core 4 on my laptop and was trying to access the 'ifconfig' command. I saw the command listed under /sbin but I couldn't access it. The problem was when I was got into superuser mode I was using the command 'su' but as soon as I used 'su -' everything worked fine. Hope that helps.

MensaWater 11-12-2005 07:58 AM

Good point al2k.

"su" by itself makes you the root user but doesn't invoke root's environment (root's own .profile) so you only have the environment you had a the user before the su. "su -" tells it to specifically to invoke root's environment when it switches user.


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