PDA

View Full Version : Q: Why /sbin/* not just command?



aero-z
12th July 2005, 01:27 PM
For example if I want to see ip configuration, then I have to type /sbin/ifconfig not ifconfig. The same is with every that type of command. I have only seen(from forums & tutorials) that no /sbin is needed in front of the command. Can I make it without /sbin in front?
Thanks :)

RahulSundaram
12th July 2005, 01:35 PM
For example if I want to see ip configuration, then I have to type /sbin/ifconfig not ifconfig. The same is with every that type of command. I have only seen(from forums & tutorials) that no /sbin is needed in front of the command. Can I make it without /sbin in front?
Thanks :)

If you login into root using "su -" rather than su your path includes sbin too and you can just run the commands

Rahul
Red Hat Inc

aero-z
12th July 2005, 01:37 PM
If you login into root using "su -" rather than su your path includes sbin too and you can just run the commands

Rahul
Red Hat Inc
Ok, thanks for that :)

alcra
12th July 2005, 02:37 PM
If you login into root using "su -" rather than su your path includes sbin too and you can just run the commands

Rahul
Red Hat Inc


my thanks to you to. I never knew about that "-" and have been typing /sbin/xxxx forever!

tejas
12th July 2005, 03:34 PM
If you still want to use some of the commands in sbin and /usr/sbin as regular users, look at the file

~/.bash_profile

Add ":/sbin:/usr/sbin" to the line about PATH=$PATH:/home/.../bin