How to use the info and pinfo commands in Linux

This tutorial explains how to use the info and pinfo commands in Linux. Learn what the Texinfo pages are and how they are organized and how they are read by the info and pinfo commands.

What are the Texinfo or Info manual pages in Linux?

When we install a software package, it automatically installs help pages that not only explain the functionality of the package but also provide a detailed description of how to use the functionality of the package.

Packages prepare their help pages in one of two formats: manual pages format and Texinfo pages format. To read manual pages and Texinfo pages, the man command and the info or the pinfo command are used, respectively.

Most packages prepare their help pages as manual pages only a few packages prepare their help pages as Texinfo pages. However, Texinfo pages provide more extensive information than corresponding manual pages.

To view a list of all Texinfo pages, you can use the following command.

#ls /usr/share/info | column

The following image shows the sample output of this command.

listing texinfo pages

I have already explained how manual pages are organized and how to use the man command to read the manual pages in the previous part of this article. In this part, we will understand how to use the info or pinfo command to read Texinfo manual pages.

This tutorial is the third part of the article "How to get help in Linux". The other parts of this tutorial are the following.

How to Use the help Command in Linux

This tutorial is the first part of the article. It explains how to use the help command to get help about shell's built commands.

How to Use the man command in Linux

This tutorial is the second part of the article. It explains what the manual pages are and how to use the man command to read them.

What are the nodes in Texinfo pages?

Texinfo pages are organized into sections. These sections are known as nodes. A node describes a particular subject of a Texinfo page. Since a node contains information only about a specific subject, we can use nodes to find and view the required information quickly and efficiently.

How to view or read Texinfo pages?

We can use the info or the pinfo command to view Texinfo pages of a package. Both the info and pinfo commands format and display a Texinfo page differently. The info command formats document in plain text format while the pinfo command formats document in standard web format.

Syntax of the info command

To use the info command, use the following syntax.

#info title-of-Texinfo-page

For example, to view the Texinfo pages of the bash shell from the info command, use the following command.

#info bash

The following image shows the output of this command.

sample output of info command

Syntax of the pinfo command

To use the pinfo command, use the following syntax.

#pinfo title-of-Texinfo-page

For example, to view the Texinfo pages of the bash shell from the info command, use the following command.

#pinfo bash

The following image shows the output of this command.

sample output of the pinfo command

Header information

In the output of both commands, the first line at the top of the screen is known as the header. A header not only shows the name of the Texinfo page being displayed but also displays the name of the current, next, and previous nodes.

The following image shows a sample of the header in the output of both commands.

header section in output of info and pinfo commands

Navigating through output

Texinfo documents may contain many pages. By default, both commands only display the first page of the Texinfo page. To view the remaining pages, we have to navigate the output.

The following table lists the keys that you can use to navigate the output of the info command.

Key Action
Down arrow To move to the next line
Up arrow To move to the previous line
Spacebar To move to the next page
Del To move to the previous page
] To move to the next node
[ To move to the previous node
t To move to the top node of the document
s To search a string in the forward direction
{ To search the previous occurrence of the string
} To search the next occurrence of the string
q To quit from the document

The following table lists the keys that you can use to navigate the output of the pinfo command.

Key Action
Down arrow To move to the next line
Up arrow To move to the previous line
Spacebar To move to the next page
Del To move to the previous page
n To move to the next node
p To move to the previous node
s To search a string in the forward direction
q To quit from the document

Viewing manual pages from the info or pinfo command

If you use the info or pinfo command to view a manual page, in output there will no information about nodes as the manual page organize information in sections and both commands do not recognize sections.

To verify this, let's view the manual page of the passwd command from the info and pinfo commands.

#info passwd
#pinfo passwd

The following image shows the output of the above commands.

viewing manual page from info and pinfo commands

Since a manual page does not organize information in nodes, if you use the info or pinfo command to view the manual page, the keys that are used to switch between nodes in the output of both commands will not work.

So if you want to view a manual page, use the man command. Or if you want to view a Texinfo page, use the info or pinfo command.

That's all for this tutorial. If you like this tutorial, please don't forget to share it with friends through your favorite social network.

Advertisements

ComputerNetworkingNotes Linux Tutorials How to use the info and pinfo commands in Linux