Find Out About Commands with man


Find Out About Commands with man

man ls

Want to find out about a Linux command? Why, it's easy! Let's say you want to find out more about the ls command. Enter man ls, and the man (short for manual) page appears, chock full of info about the various facets of ls. try the same thing for some of the other commands you've examined in this book. You'll find man pages for (almost) all of them.

Still, as useful as man pages are, they still have problems. You have to know the name of a command to really use them (although there are ways around that particular issue), and they're sometimes out of date and missing the latest features of a command. They don't always exist for every command, which can be annoying. But worst of all, even if you find one that describes a command in which you're interested and it's up to date, you might still have a big problem: It might be next to useless.

The same developers who write the programs usually (but not always) write the man pages. Most of the developers who write applications included with a Linux distribution are excellent programmers, but not always effective writers or explainers of their own work. They know how things work, but they too often forget that users don't know the things that the developers find obvious and intuitive.

With all of those problems, however, man pages are still a good resource for Linux users at all levels of experience. If you're going to use Linux on the command line, you need to learn how to use and read man pages.

As stated before, using this command isn't hard. Just enter man, followed by the command about which you want to learn more.

$ man ls LS(1)     User Commands     LS(1) NAME   ls - list directory contents SYNOPSIS   ls [OPTION]... [FILE]... DESCRIPTION   List information about the FILEs (the current   directory by default).   Sort entries alphabetically if none of -cftuSUX   nor --sort.   Mandatory arguments to long options are mandatory   for short options too.   -a, --all     do not hide entries starting with .   -A, --almost-all     do not list implied . and .. [Listing condensed due to length] 


The list of data man provides in this case is quite extensiveover 200 lines worth, in fact. Of course, not all commands provide that much, and some provide far more. Your job is to read the various sections provided in a man page, which usually (but not always) consist of the following:

  • NAME The name of the command and a brief description

  • SYNOPSIS The basic format of the command

  • DESCRIPTION A longer overview of the command's purpose

  • OPTIONS The real meat and potatoes of man: The various options for the command, along with short explanations of each one

  • FILES Other files used by the command

  • AUTHOR Who wrote the command, along with contact information

  • BUGS Known bugs and how to report new ones

  • COPYRIGHT This one's obvious: Information about copyright

  • SEE ALSO Other, related commands

Moving around in a man page isn't that hard. To move down a line at a time, use the down arrow; to move up a line at a time, use the up arrow. To jump down a page, press the spacebar or f (for forward); to jump up a page, press b (for backward). When you reach the end of a man page, man might quit itself, depositing you back on the shell; it might, however, simply stop at the end without quitting, in which case you should press q to quit the program. In fact, you can press q at any time to exit man if you're not finding the information you want.

It can be hard to find a particular item in a man page, so sometimes you need to do a little searching. To search on a man page after it's open, type /, followed by your search term, and then press Enter. If your term exists, you'll jump to it; to jump to the next occurrence of the term, press Enter again (or n), and keep pressing Enter (or n) to jump down the screen to each occurrence; to go backward, press Shift+n.



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net