4

Some do...some don't work.

ifconfig
-bash: ifconfig: command not found
3
  • 1
    What kind of machines are they? What distro? Nov 1, 2009 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, 2009 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, 2009 at 17:34

3 Answers 3

12

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

/sbin/ifconfig

2
  • 6
    You can also modify your PATH variable to include /sbin directory.
    – Misha M
    Nov 1, 2009 at 2:39
  • Worked for me on Debian 7.
    – its_me
    Jun 10, 2013 at 8:43
1

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.

2
  • And, IIRC, neither do Debian based.
    – user24524
    Nov 1, 2009 at 15:18
  • Debian very definitely does Samix.
    – Lee B
    Nov 1, 2009 at 23:51
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .