Skip to main content

Understanding a Program's Info Entry in Linux and How to Use the `info` Command

Introduction

In the Linux ecosystem, understanding how to effectively navigate and use documentation is crucial. While man pages are often the go-to for quick reference, the info utility offers a more detailed and organized view of documentation. In this article, we'll explore what an info entry is, how to navigate it, and the different ways the info command can be used.

What is an Info Entry?

The GNU Info system was developed to provide detailed, structured documentation for programs, functions, and libraries. It serves as a supplement, or in some cases, a replacement, for traditional man (manual) pages. Info entries are usually more extensive than man pages and are structured as hyperlinked documents that can be easily navigated, much like web pages.

Info entries are stored in the .info format and are commonly found in /usr/share/info/ or /usr/local/share/info/.

How to Use the info Command

To launch the info browser and start reading the documentation for a particular command, library, or program, you can simply type:

info [topic]

where [topic] is the name of the program, command, or library you want to learn about.

  • Space: Scroll down
  • Delete or Backspace: Scroll up
  • n: Next node
  • p: Previous node
  • u: Up one level
  • q: Quit info browser

Examples

Viewing General Info Directory

info

This command opens the top-level directory of all available Info documentation.

Viewing Info Entry for a Specific Command (e.g., ls)

info ls

This command opens the Info entry for the ls command, displaying detailed information on its usage, options, and examples.

Searching for Commands Containing a Keyword

info --apropos=keyword

This searches for all info entries that have keyword in their metadata or content and displays a list of matches.

Viewing a Specific Section of an Entry

info 'ls#OPTIONS'

This command jumps directly to the "OPTIONS" section of the ls info page.

View Info Entry as Plain Text

info --subnodes -o out.txt ls

This saves the Info entry for ls, including all its subnodes, to out.txt in plain text format.

Table of info Commands

CommandDetailed Explanation
infoOpens the top-level Info directory
info [topic]Opens the Info page for the specified topic
info --apropos=keywordSearches for Info entries containing keyword
info -k keywordAlias for --apropos, searches for keyword
info --subnodesIncludes all subnodes when displaying an entry
info --output=fileRedirects output to a file
info --wherePrints the location of the Info file for a topic
info --vi-keysEnables vi-like key bindings

man vs info

Featureinfo Commandman Pages
StructureHyperlinked, tree-like structureLinear, scrollable text
NavigationNavigate through hyperlinks and nodesScroll up and down
Detail LevelUsually more detailed, covers the topic exhaustivelyTends to be concise, providing essential information
InteractivityMore interactive, resembling a basic web browserMostly static text, less interactive
Search FunctionalityCan search within the document and navigate to specific nodesCan search within the page, but lacks hyperlinking
ExamplesOften contains examples, especially for complex commandsMay contain examples, but usually fewer and less detailed
File FormatStored in .info filesStored in .gz files (compressed groff text)
File LocationUsually in /usr/share/info/ or /usr/local/share/info/Usually in /usr/share/man/
Multimedia ElementsMay contain menus and ASCII artGenerally plain text, lacking multimedia elements
Command OptionsVarious options like --apropos, --subnodes, --output, etcFewer options, primarily focuses on displaying the manual page
User ExperienceDesigned for in-depth reading and learningSuitable for quick look-ups and command synopsis
HistoryDeveloped by the GNU Project as an enhancement to manTraditional Unix documentation system

Conclusion

The info command provides a structured, detailed, and navigable way to access documentation on Linux systems. Whether you're a beginner looking for guided explanations or an experienced user in need of a quick reference, info is an invaluable tool. Familiarizing yourself with info entries and commands can greatly enhance your proficiency in Linux.

What Can You DO Next 🙏😊

If you liked the article, consider subscribing to Cloudaffle, my YouTube Channel, where I keep posting in-depth tutorials and all edutainment stuff for software developers.

YouTube @cloudaffle