Open In App

info command in Linux with Examples

Last Updated : 24 Sep, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

info command reads documentation in the info format. It will give detailed information for a command when compared with the man page. The pages are made using the Texinfo tools which can link with other pages, create menus, and easy navigation.

Here, we will explore the functionality of the info command, its syntax, options, and practical examples to help you understand how to use it effectively.

Syntax

info [OPTION]... [MENU-ITEM...]

where,

  • 'OPTIONS': Modify the behavior of the command.
  • 'MENU-ITEM': Specify a particular section or node in the documentation to visit.

Key Options for the info command

The info command supports several options that enhance its functionality. Below are the most useful ones:

OptionDescription
-a, --allUse all matching manuals.
-k, --apropos=STRINGLook up STRING in all indices of all manuals.
-d, --directory=DIRAdd DIR to INFOPATH.
-f, --file=MANUALSpecify the Info manual to visit.
-h, --helpDisplay help and exit.
-n, --node=NODENAMESpecify nodes in the first visited Info file.
-o, --output=FILEOutput selected nodes to FILE.
-O, --show-options, --usageGo to the command-line options node.
-v, --variable VAR=VALUEAssign VALUE to the Info variable VAR.
--versionDisplay version information and exit.
-w, --where, --locationPrint the physical location of the Info file.

info Command In Linux Examples

1.-a:

It use all matching manuals and display them for a particular command.

 info -a cvs 


2. -k:

It look up STRING in all indices of all manuals and then display the same.

 info -k cvs 


3. -d:

It adds DIR to INFOPATH and also display the same.

 info -d cvs 


4. -O:

It go to command-line options node for a particular command and display the same.

 info -O cvs 


5. -w Command:

It print physical location of Info file.

 info -w cvs 


Differences Between Man and Info Pages

While both man and info pages are essential documentation tools in Linux, they serve slightly different purposes:

  • Man pages are concise and linear, providing a quick reference for commands and their options.
  • Info pages are more detailed and structured, offering in-depth explanations, examples, and navigational features through menus and links.

Note:

To check for the manual page of info command, use the following command:

man info

To check the help page of info command, use the following command:

info --help 

Conclusion

The info command is a powerful tool that provides a more thorough look into Linux commands and programs than man pages. Its structured approach, with menus and navigation options, allows users to look deeper into the documentation, making it an invaluable resource for Linux users who need to explore commands in greater detail.


Next Article

Similar Reads