The info command in Linux: extended documentation of commands

Introduction

In the world of Unix-like operating systems, documentation is a fundamental piece for the daily work of administrators, developers, and advanced users. Although the man command remains the most well-known reference, another tool offers a richer and more structured reading experience: the info command. This program is part of the GNU project and allows access to manuals in hypertext format, with linked nodes that facilitate the search for related information. In this article we will explore what info is, how it differs from man, how to install it, and how to get the most out of it in the terminal.

What is the info command?

The info command is a documentation viewer that belongs to the GNU utilities suite. Unlike man pages, which are designed to be read linearly in the terminal, info documents are organized in a structure of nodes and subnodes, similar to a small hypertext website. Each node contains a title, a brief summary, and links to other related nodes, allowing the user to jump directly to the section of interest without having to read the entire document from top to bottom. Moreover, info supports keyword searches, indexes, and the ability to follow cross-references between different manuals, making it a very powerful tool for delving into the workings of system commands and libraries.

Differences between info and man

Although both man and info come from the same GNU ecosystem and share the goal of providing help to the user, there are notable differences in their presentation and usability. Man pages are designed to be concise and are presented as a single flow of text divided into standard sections (NAME, SYNOPSIS, DESCRIPTION, OPTIONS, etc.). In contrast, info documents can be much more extensive and are divided into nodes that may contain code examples, tables, and cross-references. Another distinctive aspect is the navigation interface: info uses keyboard shortcuts inspired by Emacs (such as n for next node, p for previous, u to go up to the parent node, and l to return to the last visited node), while man is mainly controlled with the arrow keys and the space bar. Finally, info allows searching within the entire documentation tree using the s command, whereas in man this requires using / and repeating the search on each page.

Installing the info package

In most modern Linux distributions, the info package comes pre-installed as part of the basic toolset. However, in some minimal installations or container environments it may be absent. To verify, simply run which info or info –version in the terminal. If the command is not found, it can be easily installed using the corresponding package manager: on Debian or Ubuntu with sudo apt-get install info, on Fedora with sudo dnf install info, on Arch Linux with sudo pacman -S info, and on openSUSE with sudo zypper install info. After installation, the command will be immediately available and you will be able to access the documentation of any package that includes an info manual.

Basic navigation in info

Once you have info ready, starting to read is as simple as typing info followed by the name of the command or package you wish to consult, for example info ‘coreutils’ or info ‘bash’. Upon entering, you will see the screen divided into two parts: the header showing the current node and its location, and the body where the content is displayed. The most useful keyboard shortcuts are: n to advance to the next node, p to go back to the previous node, u to go up to the parent node, m to open a menu of options and choose a specific node, and l to return to the last visited node. You can also use the space bar to scroll page by page within the same node. Below is a list of the most common shortcuts:

  • n – Next node
  • p – Previous node
  • u – Parent node
  • m – Node menu
  • l – Last visited node
  • Space – Scroll page down
  • b – Scroll page up
  • s – Search a string throughout the document
  • Ctrl+g – Cancel operation

With these shortcuts you can move quickly through the documentation and find the information you need without wasting time.

Advanced usage and search

Beyond basic navigation, info offers advanced functionalities that make it indispensable for users who need to delve deeper into the documentation. The s command allows starting an incremental search: by typing s followed by the desired string, info will highlight all matches and you can navigate between them using , for the next match and . for the previous one. Additionally, info supports viewing indexes via the i command, which displays an alphabetical list of terms and their associated nodes, facilitating quick location of specific functions. Another useful resource is the ability to follow cross-references to other manuals: if within a node you find a reference like *note another topic::, simply press Enter on it to jump to the linked node. Finally, you can print the current node or save it to a file using the p and o commands respectively, which is handy for creating personal notes or offline documentation.

Conclusion

The info command represents a valuable and often underestimated alternative to the traditional man. Its hypertext format, powerful keyboard shortcuts, and ability to link related information make it an ideal tool for those seeking to understand in depth the functioning of commands and libraries on a Linux system. We invite you to try it in your next terminal session and explore the richness of the GNU documentation that is just a command away.

This post is also available in ESPAÑOL.

Leave a Reply

Your email address will not be published. Required fields are marked *

Esta obra está bajo una Licencia Creative Commons Atribución 4.0 Internacional para Francesc Roig francesc@vivaldi.net .