Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Some do...some don't work.

ifconfig
-bash: ifconfig: command not found
share|improve this question
1  
What kind of machines are they? What distro? –  blauwblaatje Nov 1 '09 at 2:20
3  
Note that that error message indicates that the program couldn't be found, not that it didn't work. (There's a difference) –  David Z Nov 1 '09 at 6:05
    
I highly suggest getting out of the habit of using 'ifconfig' on Linux machines - it is deprecated in favour of iproute2 (ip <command>) –  MikeyB Nov 1 '09 at 17:34

3 Answers 3

up vote 12 down vote accepted

I think this is when ifconfig is in /usr/sbin which is not in a non-admin user's path. Try:

/sbin/ifconfig

share|improve this answer
6  
You can also modify your PATH variable to include /sbin directory. –  Misha M Nov 1 '09 at 2:39
    
Worked for me on Debian 7. –  its_me Jun 10 '13 at 8:43

Redhat-based distros don't include much in root's path for (imho, misguided) security reasons. Add /sbin;/usr/sbin;/usr/local/sbin to your path, or just memorise where your commands are stored are and specify the paths when running.

share|improve this answer
    
And, IIRC, neither do Debian based. –  user24524 Nov 1 '09 at 15:18
    
Debian very definitely does Samix. –  Lee B Nov 1 '09 at 23:51

If you don't want to add to the path for security reasons (so as not to "expose" all executables in those directories) you could use shell aliases.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.