Find a Command Based on What It Does


apropos

The whatis command is similar to man -f, and the apropos command is likewise similar to man -k. Both commands search man pages for the names and descriptions of commands, helping you if you know what a command does but can't remember its name.

Note

The word apropos isn't exactly in common usage, but it is a real word, and it means, essentially, "relevant" or "pertinent." The word appropriate has a somewhat similar meaning, but it's based on a different Latin root than apropos. Check the words out at www.answers.com for yourself if you're a fellow linguaphile.


Using apropos is easy: Just follow the command with a word or phrase describing the feature of the command in which you're interested.

$ man list No manual entry for list $ man -k list last (1) - show listing of last logged in users ls (1) - list directory contents lshw (1) - list hardware lsof (8) - list open files [Listing condensed due to length] $ apropos list last (1) - show listing of last logged in users ls (1) - list directory contents lshw (1) - list hardware lsof (8) - list open files [Listing condensed due to length] 


Just like whatis, you can use the -w (or --wildcard) or the -r (or --regex) options for searches. More interestingly, though, you can use the -e option (or --exact) when you want to tightly focus on a word or phrase, without any exception. For instance, in the previous listing, searching for list turned up the last command because it had the word listing in its description. Let's try that same search, but with the -e option.

$ apropos -e list ls (1) - list directory contents lshw (1) - list hardware lsof (8) - list open files [Listing condensed due to length] 


This time, last doesn't show up because you wanted only results with the exact word list, not listing. In fact, the list of results for list went from 80 results without the -e option to 55 results with the -e option, which makes it far easier to precisely target your command searches and find exactly the command you want.



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net