When you buy a new tool, piece of equipment, or hardware device, in the box you’ll find a useful manual. The manual covers various methods to use device, safety procedures and troubleshooting tips. These manual books are an invaluable knowledge tool when learning to use new equipment – what about computers though?
When it comes to computers you rarely, if ever, get a physical manual. When you do it’s usually going to be very specific to the hardware of the device, but not the software. On UNIX based OS’s when you need to read about software you pull up the man pages. Short for manual pages, the man pages are a type of document that provides details on using various commands and applications. Man pages are super simple to use and can help you learn without Google!
What is a man page?
A man page is a piece of documentation that is distributed and read digitally. Almost every package you install on a UNIX-based OS will include some type of man page. These documents cover topics from: programs, command-line tools, system calls, and even abstract concepts.
How do I read a man page?
Reading man pages is super simple to do! You will simply run the following command:
You can either hop into your server via SSH, or open a command-line application if you’re working on a local system. Then simply adjust the `<something>` item to match the man page you want to read. It’s really that simple, I promise; the documentation in the man page however may be a little more complex.
Man Page Example:
As mentioned they really are super simple to use. For an example we’ll hop into the man page for nginx! To pull this up we’ll simply run:
This command will open the man page where you can navigate the document with your keyboard. For the nginx man page you should see something like this:
You’ll use your arrow keys to navigate the pages and you can always hit q to quit, or h for help docs detailing controls. Now that you know about the man pages, if you ever find yourself lacking internet and without Google you have an offline resource to tap into!
If you ever find yourself lost and unsure where to start reading, the man pages has a search function! You should definitely memorize this one simple command, it’ll be useful if you’re in a bind.
man -k apache
a2disconf (8) - enable or disable an apache2 configuration file a2dismod (8) - enable or disable an apache2 module a2dissite (8) - enable or disable an apache2 site / virtual host a2enconf (8) - enable or disable an apache2 configuration file a2enmod (8) - enable or disable an apache2 module a2ensite (8) - enable or disable an apache2 site / virtual host a2query (1) - retrieve runtime configuration from a local Apache 2 HTTP server ab (1) - Apache HTTP server benchmarking tool apache2 (8) - Apache Hypertext Transfer Protocol Server apache2ctl (8) - Apache HTTP server control interface apachectl (8) - Apache HTTP server control interface check_forensic (8) - tool to extract mod_log_forensic output from apache log files logresolve (1) - Resolve IP-addresses to hostnames in Apache log files rotatelogs (8) - Piped logging program to rotate Apache logs
In our example we’ll search for Apache, but you can try anything you want!