ifconfig : Command 'ifconfig' is available in '/sbin/ifconfig'
Try the command below
export PATH=$PATH:/usr/sbin
OR (if you want to set all the paths)
export PATH=$PATH:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/bin:/usr/games
Your original $PATH
(the line you posted is not very readible):
/home/sahil/.rvm/gems/ruby-1.9.3-p125/bin:
/home/sahil/.rvm/gems/ruby-1.9.3-p125@global/bin:
/home/sahil/.rvm/rubies/ruby-1.9.3-p125/bin:/home/sahil/.rvm/bin:
/usr/local/bin:/usr/bin:/bin:/usr/games:
/home/sahil/.rvm/bin{}:
/home/android-sdks/{}:
/home/android-sdks/platform-tools/{}:
/home/android-sdks/tools/{}:
/home/sahil/android-sdks/tools{}:
/home/sahil/android-sdks/tools:
/home/sahil/android-sdks/platform-tools/
You have /usr/local/bin
, /usr/bin
and /bin
. As you already found out ifconfig
is inside /sbin
.
So where that path is set you also need to include /sbin
.
See rubygems docs on how to do this.
/sbin is normally part of path. Other distros like fedora dont have it in PATH for normal users but I think Ubuntu always does. I will suggest you check your /etc/environment file and see if it is valid and has /sbin added to path. When I run cat /etc/environment, I get following output:
adnan@adnan-laptop:~$ cat /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
As you can see /sbin is already part of PATH environment variable. If your file has the same contents then check its permissions otherwise add /sbin to PATH in this file. For me the permissions are:
adnan@adnan-laptop:~$ ls -l /etc/environment
-rw-r--r-- 1 root root 79 2009-10-29 01:55 /etc/environment
You could easily solve this by adding /sbin
to $PATH
. The more important point is that, you should not have /sbin
in the path by default.
See this page for a description of why:
/sbin
directory definition
/sbin
contains system utilities that should be run by root or using sudo authority. So if you want to see your network configuration simply type:
sudo /sbin/ifconfig
You will be prompted for your password and then ifconfig
will run.