Need More Info?

Here's how to get the information you need using GNU's hypertext system called info.

Have you ever been reading along in a man page and come across something like, “SEE ALSO gdb entry in info” and wondered what it meant? Still perplexed, did you pick up Running Linux or Unix Unleashed and fail to find one word about info? If so, this article is for you.

Background

info (information) is the GNU project's hypertext system filling the gap between the man pages and printed reference books. info is a viewer for info files. Without going into excruciating detail, info files are rigidly formatted text files that are processed with the texinfo program, and then compiled by makeinfo. They end up in gzip format and usually live in /usr/info/ (at least on Slackware 96). The info program's job is to uncompress them and present them to the reader. Info files can also be viewed with Emacs, but this article will focus only on the stand-alone info program.

The info files make up a cross-referenced, virtual hierarchy of documentation. At the top of this hierarchy is the directory node. If you run info without arguments at your command prompt, the directory node opens on your console. The directory node serves as the master index for all info documentation on your computer and provides a point of entry into all these other files. The files can also be accessed directly, without going to the directory node first. For example, I can type info make at my prompt and go directly to the documentation for make.

info's documentation is divided into nodes—structures that are basically analogous to paragraphs. A node can be one short sentence or several screens. Nodes are physically stored in files. The info program allows both cross and vertical links between nodes. Once inside info, you can move from node to node in a random search for data, or you can quickly find and go to specific information. The documentation's level of detail increases as you move down the hierarchy tree. At any given level of detail, you can follow cross references to related topics at approximately the same level of detail.

Of course, someone has to write the documentation for it to be available, and not all Linux software has data available for info. Most info data deals with gcc, g++, gdb, make and other topics related to programming and systems administration. In other words, lots of info documentation exists for older software; this makes sense as info has been around for a while. Users researching these areas are fortunate in that they will find a gold mine of information that's as easy to read as a man page.

Hands On

Essential GNU Info Reference Card

At this point, you may wish to look at the Reference Card and, with these essential commands in mind, try navigating info on your Linux system. Just enter info at the prompt and start reading. I recommend entering h at the directory node and working through the on-line tutorial first thing. The whole course only takes about half an hour. The only confusing point I found was that info files can only be printed from within Emacs (the M-x print-node option). Neither the tutorial nor the info man page makes this clear, but I found it to be true.

New Info Files

What happens when you get a new software package, mgetty for instance, that includes several info files as part of its native documentation? You could just leave those files where they are and accept the fact that you would have to run info mgetty to view them. Or you could install the new files into the existing hierarchy. You don't even have to move them to the default info directory.

First, note the location of the new info files. I'll stick with mgetty as an example. These files were installed in /usr/local/info/. In this case, the master info file is named /usr/local/info/mgetty.info. Master info files always end with the .info suffix.

Next, add mgetty's entry to info's directory file. To do this, edit the file /usr/info/dir as root. Move down to an appropriate location for the new entry. I chose “Miscellaneous commands and documents”, the next to last section. Menu entries in the dir file consist of three sections. The first is the menu entry name, starting with an asterisk and followed by a colon. The second is the menu file name in parentheses, followed by a period. (The .info suffix isn't needed here, even though it's part of the actual file name.) The third section is the package description, which contains the following entry for mgetty:

*mgetty:        (mgetty).       mgetty documentation.

Add this line to the /usr/info/dir file and exit saving the file. Finally, info has to be able to find mgetty's info files, since they're not in the default directory, /usr/info/. Although we could specify (/usr/local/info/mgetty) in our entry's second part, that would really make the dir file ugly. The most aesthetically pleasing solution is to set the INFOPATH variable. The directories in INFOPATH are searched by the info program for data files. So, add the line:

export INFOPATH=/usr/info:/usr/local/info
to /etc/profile, and on the next login, all users will be able to access mgetty's info documentation just as if it had always been part of the hierarchy. If mgetty is ever upgraded—no problem—info finds the new documentation with no further adjustments.

______________________

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState