As you may already know, many of the tools comprising a typical Linux distribution come from the GNU project. Info is the preferred online documentation format used by the GNU project. So, you will want to become familiar with Info to read online documentation for Linux programs. Fortunately, this is not a difficult task.
Info format is a form of hypertext ("text with links"). You should be quite familiar with the concept of hypertext from browsing the web, because web browsers present HTML to you as hypertext.
Since Info is just a documentation format, you could, in theory, use any program to read documentation in Info format. However, the most common and widely-available reader for the Info format is the program named -- surprise! -- info.
The simplest way to run the info documentation reader is to type:
infoYou will then get a list of programs for which the documentation in the Info format has been installed, and will need to select the program you want to read about. You could also give the name of the program on the command line, skipping selecting from the menu of available documentation. So, to jump straight to the gdb manual, you could type:
info gdband to jump straight to the C Library manual, you could type:
info libcFinally, if you know the full path to the file that contains the documentation in the info format, you can type
info -f PATHFor example, to read the documentation contained in the file gdb.info in the current directory, you can type:
info -f ./gdb.infoRegardless of how you had started the info program, you always exit it in the same way: by typing the character `q'.
Hitting the spacebar scrolls one screenfull forward, and hitting Backspace scrolls one screen back. You can also use Emacs-style C-v, M-v to scroll forward and backwards, respectively. Emacs-style movement keys (i.e., C-n C-p C-f C-b) also work, as do the arrow keys.
I said earlier that Info was a hypertext format, so you may well be wondering when I will finally talk about links. The answer is (drum roll, please) now. HTML, as you know, has only one kind of hyperlink, the one you create with an <a href="..."> tag. Info, on the other hand, has two somewhat distinct types of links: menus and cross-references.
Here's what Info's menus look like:
* Menu: * Gnus: (gnus). The news reader Gnus. * Message: (message). The Message sending thingamabob. * Emacs MIME: (emacs-mime). Libraries for handling MIME.As you can see, menu links have the string "* Menu:" on a line by itself, followed by a list of menu items, one per line. Each menu item's line starts with an "*"(asterisk). Here is another example of an Info menu:
* Menu: * Starting Up:: Finding news can be a pain. * The Group Buffer:: Selecting, subscribing and killing groups. * The Summary Buffer:: Reading, saving and posting articles.
A cross-reference looks like this:
maintenance much tidier. *Note Foreign Groups::.As you can see, a cross-reference has the string "*Note" followed by the name of the cross-reference.
You can follow both menus and cross-reference links in the same way: by placing the cursor on the name of the link and hitting Enter (this is analogous to clicking a link in your web browser). You can get back to where you were before you had followed the link by typing `l', for "last" (this is analogous to hitting the "Back" button in your web browser).
So, if you can navigate both kinds of Info links in the same fashion, why are there two kinds? Well, first, the two kinds of links serve somewhat different purpose (there is a difference between a table of contents and a cross-reference), and second, you can navigate the two kinds of links differently, too. To follow a menu link, you type `m', for "menu", followed by the name of the link, and to follow a cross-reference, you type `f', for "follow", followed by the name of the link. This may be faster than moving the cursor around the screen all the time, and, since info provides tab completion for both menu items and cross-references (type part of the name, hit TAB, and let info complete the rest of the name for you), this may even be more convenient as well.
A unit of contents is called a node in Info. An info document typically consists of many nodes, and all the nodes of a document form a tree (I am using "tree" somewhat loosely here). You can move to the next node by typing `n', or simply by hitting spacebar once you reach the end of the node. Since hitting spacebar scrolls one screenful forward, repeatedly hitting spacebar is a convenient way to read the document's nodes in sequence. Typing `p', for previous, takes you to the previous node, while typing `u' takes you "up" the tree to the parent of the current node. The parent of the current node is usually sensibly defined (for example, if you are in the middle of a chapter/section, the parent of the current node would normally be the node containing the table of contents for the current chapter/section).
Info documents usually come with an index. To seach the document's index for a string, you type `i' followed by the string you want to search for. Tab completion is available here as well, so this may be a good way to explore the document's index. If `i' doesn't find what you are looking for at first, you can hit `,`(comma) to go to the next match.
Finally, you can also search Info documents with Emacs-style interactive search by typing `C-s', and search a document for a regular expression by hitting `s' There is no tab completion for either one of those commands, sorry ;-).
I hope this provides you with basic information to start using info effectively. If you are curious about other features info provides, you can work through the online tutorial by starting info, and then typing `h', or you can read the info manual by typing "info info" on the command line.