This lesson will show you how to find help using several methods of retrieving information about UNIX’s built-in commands and capabilities.
If you’ve poked around your UNIX system at all, you’ve probably noticed that there are literally thousands of different files and applications on your computer. You might find this to be a bit overwhelming at first, but the diversity and extensive capabilities of the operating system are part of its attraction. If there is something you want to do, you can bet that UNIX has a utility or combination of utilities that can get the job done. The biggest question on your mind is probably, “How do I use this stuff?”
Although some UNIX commands provide instant feedback and help information to you if you simply type the command on the command line, this help is usually only useful for the experienced user who just needs a quick reminder. The UNIX manual (man) pages, on the other hand, are the quickest and easiest source for complete information on how to use the commands on your system. They provide information on what programs do and how to use them, as well as on other related utilities that you might be interested in checking out. If you’re a programmer, man pages can also provide useful programming information.
man
To display a manual page, use the man command. In its simplest form, you can use man followed by the command you want to look up.
For example, to look up the man page for the date command:
>man date
DATE(1)
DATE(1)
NAME
date - print or set the system date and time
SYNOPSIS
date [-u] [-d datestr] [-s datestr] [--utc]
[--universal] [--date=datestr] [--set=datestr]
[--help] [--version] [+FORMAT]
[MMDDhhmm[[CC]YY][.ss]]
DESCRIPTION
This manual page documents the GNU version of date.
date with no arguments prints the current time and date
(in the format of the `%c' directive described below).
If given an argument that starts with a `+', it prints
the current time and date in a format controlled by
that argument, which has the same format as the format
string passed to the `strftime' function.
...
Tip:
Turn off the Alarm Don’t be alarmed if your system returns information which differs from what is shown here in response to man date. Different manufacturers—and different versions of UNIX—sometimes provide slightly different commands, and the man pages you see reflect the correct information for your system.If your man command returns with no information, a complaint that it can’t find the man page for date, or—worse yet—the dreaded command not found response, contact your system administrator. You might be stuck on a machine with missing or broken man pages, and your administrator can most likely fix it for you.
Tip:
How do I Read the Rest? When you see a ... on your screen, there’s more text to be read. The man pages won’t scroll automatically, so you’ll need to press the Spacebar to see additional text. Press q to quit the page and return to the command line.
This is only a tiny subset of the information that is returned via the man command, but enough for you to get the picture. You’ll soon find that using man pages to learn about everything that is available on your system is going to take a bit of time. You can speed things up by viewing a summary description of a command through one of four different commands: man -f, man -k, whatis, or apropos, followed by the name of the command you’d like to explore. Each of these functions returns similar results, but there are two different ways that the search is performed.