Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

bash: ifconfig: command not found

Status
Not open for further replies.

JBL312

IS-IT--Management
Jan 14, 2004
56
US
I have been unable to execute the ifconfig command and would like to find out why. I have tried to execute this command while logged in with my user account. I created this account when I installed the OS and have not changed any of it's permissions or added it or removed it from any groups. I have also tried to use “su root” but I get the same message when I try and run it like this as I get when I try and run it normally.

The message that I receive while trying to execute ifconfig with my user account is the following.

[]$ ifconfig
bash: ifconfig: command not found

And after executing “su root” I receive the same message.

[]# ifconfig
bash: ifconfig: command not found

Does anyone have any ideas why this is happening? This is not the first time nor command that I have had this problem with.

I am currently running Fedora Core 1. I know this is an old version, I am in the process of downloading Core 3.
 
Redhat amongst other distros has a default PATH statement for common users that does not include /sbin /usr/sbin and /usr/local/sbin (amongst other valuable paths for admins).

You can solve this a couple of ways....

I typically modify my OWN user account's .bash_rc or .bash_profile (I always forget which one) to include the above paths in the PATH statement after the existing path.

It is my understanding/experience that when you sudo su you seem to keep your USER PATH as the setting you operate with. Thus, when the default (skel) user PATH does NOT contain these admin dirs, you end up with the APPEARANCE that the admin utilities are inaccessible.

Stupid little thing really, but good for keeping user and admin proggies apart.

Internet Directory
 
its the users .bash_rc file. Easier file to edit. I would suggest editing the .bash_rc file in /etc/skel so that every new user created will haev the same PATH variable as root

Life is a mind game
Wanna Play?
 
Thank you for the feedback on this. I will keep it in mind. I have just been using su – and things were working fine.
 
The dash (-) in su is required to "simulate" a login which will set the PATH environment variables for that user according to the .bash_rc file. So in your case,
"su - root" is the same as "su -". If you wanted to simulate a login for Fred it would be "su - Fred".

Hope that clears things up.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top