2

I often find myself alt-tabbing to google "How to do X in Linux".

Is there a way to search (say, man pages) in Linux to find tools that might be of use in a particular situation?

For example, earlier I needed the command to see how much space a folder was taking up. (Excuse my Windows terminology – I'm new to this!) Is there any way I could have found the du -h command without leaving the terminal?

3
2

The apropos command (or man -k) will return all manuals that contains the specified search term in the NAME section (the first section in any manual on Unix). This section is stored in the "whatis"-database.

To find a command that handles "space" do

$ apropos space

On OS X, that will find df ("display free disk space") and other related things (but incidentally not du, at least not on OS X, it all depends on what's in that NAME section in the manual itself on your system).

$ apropos "disk usage"

Will bring up a tighter selection including du ("display disk usage statistics").

You will have to use trial-and-error for coming up with the search terms... ;-)

The whatis utility does the opposite:

$ whatis du
du(1)                    - display disk usage statistics

Not the answer you're looking for? Browse other questions tagged or ask your own question.