Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've recently switched from Ubuntu 10.04 LTS to 12.04 LTS, and one of the changes i have noticed is that when i try to run the command ifconfig (for example to view my own ip), i get the following output:

Command 'ifconfig' is available in '/sbin/ifconfig' The command could not be located because '/sbin' is not included in the PATH environment >variable. This is most likely caused by the lack of administrative privileges associated with your >user account. ifconfig: command not found

In order to run the command, i have to run sudo ifconfig. This was not the case in 10.04, so i wonder: is there a reason for this change? Is this the expected behavior for 12.04, or is something wrong with my settings? Hopefully someone else running Ubuntu 12.04 can try running the command and see if they get the same result as me.

share|improve this question
The two existing answers don't really solve the problem in the long term. You need to make sure your $PATH is correct. Please post the output of echo $PATH. – Sparhawk Feb 16 '14 at 10:03

As the message says, the problem is that ifconfig is not in your path. You can run it as a normal user by giving the full path: /sbin/ifconfig. Try it!

My guess is that on 10.04 you added /sbin/ to your path, and didn't do that when upgrading to 12.04.

Note, however, that you will need to be root if you want to use ifconfig to change networking configurations; I hope the reasons for this are more than obvious :)

share|improve this answer

Add /sbin to PATH env var:

export PATH="$PATH:/sbin"
share|improve this answer

Your Answer


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.