[Home] [Credit Search] [Category Browser] [Staff Roll Call] | The LINUX.COM Article Archive |
Originally Published: Tuesday, 12 June 2001 | Author: Michael Stutz |
Published to: learn_articles_firststep/General | Page: 5/5 - [Printable] |
The Linux Cookbook: Chapter 2, WHAT EVERY LINUX USER KNOWS
Today's Learn article derived from Chapter Two of the
soon to be published Linux Cookbook contains a ton
of useful information for the new user. Learn all kinds of useful
commands and short-cuts for basic system operation, and then join
author Michael Stutz as he answers your questions live in Linux.com
Live! Linux.com would like to thank publisher Bill Polluck of No Starch Press for the free use of
this material.
|
<< Page 5 of 5 | |
2.8 HELP FACILITIESLinux systems come with a lot of help facilities, including compete manuals in etext form. In fact, the foremost trouble with Linux documentation isn't that there is not enough of it, but that you have to sift through the mounds of it, trying the find the precise information you're looking for! I describe the help facilities in the following sections; their relative usefulness for the particular kind of information you're looking for is noted. If you find that you need more help, don't panic--other options are available. They're described in Recipe 1.3 If you Need More Help, page 16. 2.8.1 FINDING THE RIGHT TOOL FOR THE JOBWhen you know what a particular tool or application does, but you can't remember it's name, use apropos. This tool takes a keyword as an argument, and it outputs a list of installed software whose one-line descriptions contain that keyword. This is also useful for finding software on your system related to, say, "audio" or "sound" or "sort" or some other such general concept.
$ apropos consoles "Ret"
NOTE: The apropos tool only finds exact matches, so a search for the keyword 'console' might not list the programs that a search for the keyword 'consoles' would yield, and vice versa. Another way to find tools by keyword is to search the system manual pages (see Recipe 2.8.4 Reading a Page from the System Manual, page 30). To do this, use man and give the text to search for as an argument to the '-k' option. This searches the short descriptions and manual page names for the given text, and outputs a list of those tools that match in the same format as the apropos tool.
2.8.2 LISTING A DESCRIPTION OF A PROGRAMUse whatis to list a one-line description of a program. Give the name of the tool or application to list as an argument.
$ whatis who "Ret"
NOTE: The watis tool gets its descriptions from the manual page of a given program; manual pages are described later in this section, in Recipe 2.8.4 Reading a Page from the System Manual, page 30. 2.8.3 LISTING THE USAGE OF A TOOLMany tools have a long-style option, '--help', that outputs usage information about the tool, including the options and arguments the tool takes.
$ whoami --help "Ret"
This command outputs some usage information about the whoami tool, including a short description and a list of possible options. NOTE: Not all tools take the '--help' option; some tools take a '-h' or '-?' option instead, which performs the same function. 2.8.4 READING A PAGE FROM THE SYSTEM MANUALIn the olden days, the hardcopy reference manual that came with most Unix systems also existed electronically on the system itself; each software program that came with the system had its own manual page (often called a "man page") that described it. This is still true on Linux-based systems today, except they don't always come with a hardcopy manual. Use the man tool to view a page in the system manual. As an argument to man, give the name of the program whose manual page you want to view (so to view the manual page for man, you would type man man).
$ man w "Ret"
This command displays the manual page for w:
Use the up and down arrow keys to move through the text. Type q to stop viewing the manual page and exit man. Since man uses less to display the text, you can use any of the less keyboard commands to peruse the manual page (see Recipe 9.1 Perusing Text, page 111). Despite its name, a manual page does not always contain the complete documentation to a program, but it's more like a quick reference. It usually gives a short description of the program, and lists the options and arguments it takes; some manual pages also include an example or a list of related commands. (Sometimes, commands have very complete, extensive manual pages, but more often, their complete documentation is found either in other help files that come with it or in its Info documentation; these are subjects of the following two recipes.) To prepare a man page for printing, see Recipe 25.3.4 Preparing a Man Page for Printing, page 278. 2.8.5 USING THE GNU INFO SYSTEMThe GNU Info System is an online hypertext reference system for documentation prepared in the Info format. This documentation tends to be more complete than a typical man page, and often, the Info documentation for a given software package will be an entire book or manual. All of the manuals published by the Free Software Foundation are released in Info format; these manuals contain the same text (sans illustrations) as the paper manuals that you can purchase directly from the Free Software Foundation.There are different ways to peruse the Info documentation: you can use the standalone info tool, read Info files in the Emacs editor (see Recipe 10.2 Emacs, page 121), or use one of the other tools designed for this purpose. Additionally, tools exist for converting Info documentation to HTML that you can read in a Web browser (see Recipe 5.9 Browsing Files, page 81) To read the Info manual for a tool or application with the info tool, give its name as an argument. With no arguments, info opens your system's Top Info menu, which lists all of the available manuals that are installed on the system.
$ info "Ret"
This command starts info at the system's Top menu, which shows some of the info key commands and displays a list of available manuals:
In Emacs, you can click mouse button 2 on a menu item or cross-reference to select it. * Menu: Use the arrow keys to move through each \page" of information, called an Info node. Nodes are the base unit of information in Info, and are arranged hierarchically : a manual's Top node will contain an Info menu containing links to its various chapters, and a chapter node will contain a menu with links for its sections, and so on. Links also appear as cross references in the text. Links look the same in both menu items and cross-references: an asterisk (`*'), the name of the node it links to, and either one or two colon characters (`:'). To follow a link to the node it points to, move the cursor over any part of the node name in the link and press RET. To run a tutorial that describes how to use info, type h. Type q at any time to stop reading the documentation and exit info. To read Info documentation for a tool or application, give its name as an argument to info; if no Info manual exists for that tool, info displays the man page for that tool instead.
This command opens a copy of The GNU tar Manual in info. To read the contents of a file written in Info format, give the
name of the file to read with the `-f' option. This is useful for
reading an Info file that you have obtained elsewhere, and is not
in the
This command starts info and opens the Info file `faq.info', beginning at the top node in the file. To read a specific node in an Info file, give the name of the node to use in quotes as an argument to the`-n' option.
NOTE: You can also read Info documentation directly from the Emacs editor; you type C-h i from Emacs to start the Info reader, and then use the same commands as in the standalone info tool (see Recipe 10.2.1 Getting Acquainted with Emacs, page 121). The Emacs \incremental" search command, C-s, also works in info; it's a very fast, efficient way to search for a word or phrase in an entire Info text (like this entire book); see Recipe 14.6.1 Searching Incrementally in Emacs, page 173. 2.8.6 Reading System Documentation and Help Files
The When a software package is installed, any additional
documentation files it might have beyond a manual page and Info
manual are placed here, in a subdirectory with the name of that
package. For example, additional documentation for the hostname
package is in Most packages have a file called `README', which usually contains relevant information. Often this file is compressed as `README.gz', in which caseyou can use zless instead of less. The Linux Documentation Project (LDP) has overseen the creation of more than 100 "HOWTO" files, each of which covers a particular aspect of the installation or use of Linux-based systems. The LDP HOWTOs are compressed text files stored in the
Finally, the
NOTE: It's often very useful to use a Web
browser to browse through the documentation files in these
directories (see Recipe 5.9 Browsing Files, page 81.) On
some systems, As a technology correspondent with Wired News/Reuters, MICHAEL STUTZ was one of the first journalists to write about Linux and the Open Source movement in the mainstream press. He has contributed to the GNU Project and the Linux Documentation Project, and created the Design Science License (DSL), a generalized "copyleft" license designed to fit any work.
| |
<< Page 5 of 5 |