whatis, whereis and which: In moments of indecision

In my quivering, quaking moments of fearful indecision, there are a few simple commands that usually help me find my way: whatis, whereis and which.

whatis is part of the man-db superstructure, and I think it’s safe to say that without man-db, whatis is mostly unusable. That’s because whatis skims man pages that match your search string.


Nothing particularly fancy there, and if I hadn’t checked, I would have assumed that was about all that whatis is. It does take a healthy array of flags though, representing everything from terminal output width to regex string matching.

whereis, by contrast, only tells you … where something is. Or more accurately, where its binary, source and manual page are.


You can filter whereis for any one of those things, and arrange the output a little with the available options. But it’s not much more complex than whatis. And it calls util-linux home. πŸ˜‰

which might be the most straightforward of all three, showing the path of the shell command. In other words, you give which a command, it shows you the path it will follow to reach that command.


Like the other two, which takes a few options as command-line flags, and perhaps most notable is the -a flag, which shows all matching paths, not just the first. Occasionally that might be useful. πŸ™„

(Unless I’m mistaken, which appears in Debian as part of debianutils, of all things. πŸ˜• )

There are a few other tools like these out there in the wild, but not all of them borrow so shamelessly from the Five Ws. We’ll see those later. πŸ˜‰

2 thoughts on “whatis, whereis and which: In moments of indecision

  1. Pingback: Links 28/6/2014: New Wine, Steam Update | Techrights

  2. Pingback: who and whoami: Two more quick Five Ws | Inconsolation

Comments are closed.