Problems with ifconfig in Fedora 8

Andrea Mastellone andrea.mastellone at fastwebnet.it
Tue Apr 22 08:32:09 UTC 2008


Stuart Sears wrote:
> Pedro Jose wrote:
>> Hello:
>>
>> In a Fedora 8, and also in a Centos 5.1, when I open a terminal and I
>> login as root, I type ifconfig, but the command is not detected.
>> However, when I go to a tty, Cntrl + Alt + F1, for example, and I
>> login as root, ifconfig is recongnized.
>>
>> How can I fix it?
> 
> The ifconfig command is in /sbin, which is not on a normal users PATH.
> 
> so, you can do one of 2 things:
> * type /sbin/ifconfig
> 
> or
> *change your path to include /sbin (and if you are going to do that, you 
> may as well add /usr/sbin as well)
> 
> in /home/YOURUSER/.bash_profile:
> 
> (at the bottom, ideally)
> 
> export PATH=$PATH:/sbin:/usr/sbin
> 
> and then logout and login again
> 
>>
>> (Sorry for my english, I'm spanish)
> 
> not a problem. My Spanish is lousy. :)
> 
> Regards,
> 
> Stuart

In a simpler way, you can type su - instead of su in a terminal.
This gives you also the root environment variables (including PATH).

Andrea




More information about the fedora-list mailing list