Command Help using Manual Pages (man) (OS X, Linux, BSD)

As you start using the command line, you’ll come across thousands of different commands, all with their own options and ways of taking options.  Every command is different, but help is on hand in the form of man pages.

Manual Pages (or man page for short) are the documentation distributed with every command (or, at least, should be with every command) which tells you how a particular command works.

From a Terminal in OS X, Linux, or BSD, you should have access to a command called man.  man is the reader for these man pages, and parses them nicely onto the screen for you.

So, for example, if you wanted help with the mount command, you would simply do:

man mount

… and you would be presented with the manual page for mount.

This is true of any command, and there should always be a manpage with the command. It’s good practice to do this as a developer, but you may find cases where people don’t.

There are also various web sites which have html versions of these manpages, and you can normally find these on the Linux or BSD distribution’s site you are using, or the Apple site.  For the sake of this post, the three below are for Ubuntu, FreeBSD, and OS X.

Ubuntu – http://manpages.ubuntu.com/

FreeBSD – http://www.freebsd.org/cgi/man.cgi

OS X – http://developer.apple.com/documentation/Darwin/Reference/ManPages/

So the next time you need help with a particular command, do a quick man thecommand and hopefully, you’ll have all the help you need!