One Day One GNU/Linux Command (WHEREIS)

MayaVi - A Free, Cross Platform, Easy to use GUI based scientific data
visualizer, written in Python VTK, developed by Dr Prabhu Ramachandran
(Ex Co-Ordinator - ILUGC). Links: http://mayavi.sourceforge.net/

One Day One GNU/Linux Command
=============================

whereis -- Locate the bin, src & man page for a file.

Summary :

'whereis' locates source/binary and manuals sections for specified
files. whereis will attempts to locate the desired program in a list
of standard Linux places, which is hard-coded in it.

Example:

$ whereis ls -- Display the bin, src(if avail) and man page locations.

$ whereis -b ls -- Show only bin file location.

$ whereis -m ls -- Show only man page location.

$ whereis -s ls -- Show only source file location.

$ whereis -u -M /usr/share/man/man1 -f route -- Find the bin file 
                location and search for man page in only man1 dir.

$ whereis -u -M /usr/man/man1 -S /usr/src -f * -- Find all files in
      /usr/bin which are not documented in /usr/man/man1 with source 
(Continue reading)

Sivakumar Gopalan | 7 Aug 07:52

RE: One Day One GNU/Linux Command (WHEREIS)

Just a thought. Here is the difference between whereis, locate and which

whereis - can find any file, but looks only in standard locations.

locate - can find any file from any location, however there should be a
locatedb update run frequently to have accurate results.

which - can find executables which are in the path variable.

Rgds,
Siva.
_______________________________________________
To unsubscribe, email ilugc-request@... with 
"unsubscribe <password> <address>"
in the subject or body of the message.  
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Raman.P | 8 Aug 06:30

RE: One Day One GNU/Linux Command (WHEREIS)

--- On Thu, 7/8/08, Sivakumar Gopalan <sivakumar@...> wrote:

> Just a thought. Here is the difference between whereis,
> locate and which
> 
> whereis - can find any file, but looks only in standard
> locations.
> 
> locate - can find any file from any location, however there
> should be a
> locatedb update run frequently to have accurate results.
> 
> which - can find executables which are in the path
> variable.

A similar command is type. It is shell builtin. Very fast, searches in $PATH but only executables. e.g
 type ls

A comparison with which

$ time which ls
alias ls='ls --color=tty'
        /bin/ls

real    0m0.016s
user    0m0.000s
sys     0m0.010s
$ time type ls
ls is aliased to `ls --color=tty'

(Continue reading)


Gmane