What to do when a command isn't found?

Anthony J Placilla anthony_placilla at SUTH.COM
Thu Jul 6 17:09:42 UTC 2006



Timothy Alberts wrote:
> So I get this every now and then and haven't found a smooth method of
> dealing with it.  I have my desktop upgraded from FC4 to FC5 and the
> command 'ifconfig' comes back with 'bash: ifconfig: command not found.'
> Additionally, I have been through tutorials on the web and different
> books on running commands that more often than not, the bash shell comes
> back with the same message.
> 
> My first question is, are the shell commands and features standardized
> somewhere so that I know what commands I can expect to have no matter
> what machine I'm sitting at or what type of installation I have?  My
> second question is, if these commands are supposed to be there, but the
> shell comes back and says they aren't, what is the procedure for finding
> the commands or installing the packages required for them?
> 
> I understand the 'which xxx' command will tell me the location of the
> executable that is being used when I call a command.  However it doesn't
> help me find a missing command.  I also understand that typically shell
> commands are in /bin /usr/bin /usr/local/bin among others.  If it helps,
> when I type 'which ifconfig' the following is the result:
> 
> /usr/bin/which: no ifconfig in
> (/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:
> /usr/X11R6/bin:/home/talberts/bin)
> 
> Sorry these are fairly general questions so if it's easier to just focus
> on the 'ifconfig' command that would be helpful.  Thank you for any
> response.
> 
> 
> 

In most cases, as the ifconfig command you are trying to run as an 
example, it's because the user you are logged in as does not have the 
path environment for the command.

using ifconfig you will see that it lives in /sbin & /sbin is not part 
of a normal user's $PATH

if you do an su - (the dash is important) and run the 'which ifconfig' 
query again you'll find it



-- 
Tony Placilla, RHCT, GSEC
anthony_placilla at suth.com


GPG-Key-ID: 1024D/C78F8B64              http://pgp.mit.edu
Key fingerprint = A8D5 7AFF CE88 4179 C792  D9A9 F197 2A15 C78F 8B64




More information about the users mailing list