Friday, May 22, 2009

How to find a command when you're not sure what it's called?

There is a very useful command called 'apropos' that will help you find a command based on a keyword lookup. So if your nor sure of the command or you want to find other commands that might be similar, apropos will help you. Here's an example:

> apropos more

bzless          bzmore (1)      - file perusal filter for crt viewing of bzip2 compressed text
bzmore          bzmore (1)      - file perusal filter for crt viewing of bzip2 compressed text
gzmore          gzmore (1)      - file perusal filter for crt viewing of compressed text
less            less (1)        - opposite of more
let             let (1)         - shell built-in function to evaluate one or more arithmetic expressions
more            more (1)        - browse or page through a text file
... ( this is a long list so I limited it) 

Another example:

If you type:
> apropos apach

you get a long list that includes:
apachectl(8)             - Apache HTTP Server Control Interface
apxs(8)                      - APache eXtenSion tool
httpd(8)                    - Apache Hypertext Transfer Protocol Server
logresolve(8)            - Resolve IP-addresses to hostnames in Apache log files
mod_perl2(3pm), mod_perl(3pm) - Embed a Perl interpreter in the Apache/2.x HTTP server
rotatelogs(8)            - Piped logging program to rotate Apache logs

All these commands relate to apache.

Play around with it and check out the man page.


No comments: