Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email 



THE WHATIS COMMAND


Whatis is a funny command that might come in handy as you learn Linux. Let´s give an example, we want to know what the command ¨cp¨ does:
NOTE: On some systems you have to build the database first by running "/usr/sbin/makewhatis" as root ( Thanks Owyn )


CODE
$ whatis cp
cp                   (1)  - copy files and directories


Or the command ifconfig:

CODE
$ whatis ifconfig
ifconfig             (8)  - configure a network interface


Now we can do a lot more with whatis, imagine you want to have the information on all the commands stored in, let´s say, /usr/bin. We will have to move to that directory first:

CODE
$ cd /usr/bin


And then we give the next command:

CODE
$ ls | xargs whatis | less

( the ¨|¨ are pipe signs, the ¨shfit \¨ key )

This is a part of the list you will get ( scoll page with the spacebar, and close with Q ):

QUOTE (Text @ Screen)
411toppm            (1)  - convert Sony Mavica .411 image to PPM
a2p                  (1)  - Awk to Perl translator
aclocal: nothing appropriate
aclocal-1.4: nothing appropriate
aconnect            (1)  - ALSA sequencer connection manager
acroread: nothing appropriate
activation-client: nothing appropriate
adddebug: nothing appropriate
addftinfo            (1)  - add information to troff font files for use with groff
addr2line            (1)  - convert addresses into file names and line numbers
addxface: nothing appropriate
alsamixer            (1)  - soundcard mixer for ALSA soundcard driver, with ncurses interface
amixer              (1)  - command-line mixer for ALSA soundcard driver
amor: nothing appropriate
animate              (1)  - animate a sequence of images
anytopnm            (1)  - convert an arbitrary type of image file to PBM, PGM, or PPM


( For the very curious ones: ls = list directory contents, xargs = build and execute command lines from standard input, less = opposite of more )

You can do this in any directory you like.

HINT: /bin, /usr/bin/, /sbin, /usr/sbin, and /usr/X11R6/bin are the most interesting directories to look for commands and their ¨whatis¨ explanation.

Have fun exploring !


Bruno


-- Aug 19 2003 ( Revised Dec 10 2005 ) --


Tips Linux Explorers   All Things Linux Forum   Great Linux Links   LinuxClues.com   Hometown   Email