Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a severe problem today: when I type ifconfig it does not show ip configuration on ubuntu 12.04. Can anyone help me on this?

Here is the result of ifconfig:

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
share|improve this question
    
Do you have superuser privileges? –  i08in Mar 12 at 8:37
    
Jobin i have super user priveleges. –  Farooq Mar 12 at 8:59
    
What is the output of echo $PATH? –  Braiam Mar 12 at 16:45

3 Answers 3

up vote -5 down vote accepted

Try this command :

sudo ln -s /sbin/ifconfig /usr/bin/ifconfig
share|improve this answer
7  
This isn't a solution, its a workaround. –  i08in Mar 12 at 9:21

You can do either of the following:

  • Open your ~/.bashrc file and write the following to the end:

    export PATH=$PATH:/sbin
    

and then do source ~/.bashrc or open a new terminal instance.

  • or open your /etc/environment and add /sbin to end of the PATH variable, so that is as follows:

    PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/bin:/usr/games:/sbin"
    
share|improve this answer

Add /sbin to the system path by running,

export PATH=$PATH:/sbin

If you follow @nux's answer, you have to create symbolic links for all the command files which are presented inside /sbin directory.But if you follow this or @jobin's answer, you don't need to go for that.

share|improve this answer
1  
You don't need to source when you export on the terminal. –  i08in Mar 12 at 9:21

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.