[NBLUG/talk] ifconfig

Dustin Mollo dustin at sonic.net
Thu Jun 5 11:48:01 PDT 2003


On Thu, Jun 05, 2003 at 11:42:59AM -0700, Steve wrote:
> Also when which and locate don't work you can use find

[snip]

> On Thu, Jun 05, 2003 at 11:39:58AM -0700, troy wrote:
> > Some commands to help when you don't know where something is:
> > which ifconfig
> > locate ifconfig

[snip]

it might be useful to point out why locate and/or which won't find a
command...

the command 'which' operates on whatever your particular shell's path
environment contains.  in this case, 'which' wouldn't have worked, since it
would seem that /sbin was not in your path.  'locate' would have been the
better choice here.

locate usually doesn't find things because the thing you are looking for has
been excluded from it's database.  'locate' searches against a database
that's usually rebuilt each night by a cronjob ('man updatedb' to read about
updating the database.) most systems usually exclude things like home
directories, various /tmp directories and places that non-local filesystems
might be mounted.  redhat 7.3's updatedb cronjob looks like this
(word-wrapped for your convience):

	/usr/bin/updatedb -f "nfs,smbfs,ncpfs,proc,devpts" -e \
	  "/tmp,/var/tmp,/usr/tmp,/afs,/net"

if the machine that i snarfed that line from wasn't my personal desktop, i'd
seriously consider adding in /home, or whever home directories are kept, to
that list of excludes.

-dustin



More information about the talk mailing list