info Command in Linux

Introduction to the Linux Info Command

This lab provides a comprehensive guide on using the Linux info command, a vital tool for system administrators. You will discover how to effectively leverage this command to access detailed documentation on Linux commands, utilities, and core system functions. We will delve into the command's purpose, its diverse options, and essential navigation techniques. Furthermore, you'll learn to apply the info command to retrieve specific information about a variety of Linux tools. This lab emphasizes the unique hierarchical and hypertext-like structure of the info command, offering a more efficient way to navigate related topics and cross-references compared to traditional man pages. This is invaluable for any aspiring systemadmin.

Understanding the Purpose and Application of the Info Command

This section focuses on the core purpose and practical application of the info command within a Linux environment. The info command serves as a crucial resource, delivering in-depth documentation for Linux commands, essential utilities, and fundamental system functions.

While similar to the man command in function, the info command distinguishes itself by offering a more structured and interactive documentation experience. Unlike the linear, scrollable format of man pages, the info command presents information in a hierarchical, hypertext-driven manner. This enables users to navigate effortlessly through interconnected topics and explore relevant cross-references.

Let's begin by executing the info command without any specified arguments:

$ info

This action will launch the top-level info menu, presenting a broad overview of available topics and guidance on navigating the info system.

Example output:

This is the top of the INFO tree

This (the Directory node) gives a menu of major topics.
Typing "q" exits, "?" lists all INFO commands, "d" returns here,
"h" gives a primer for first-timers,
"mEmacs<Return>" visits the Emacs manual, etc.

In Emacs, you can click mouse button 2 on a menu item or cross-reference
to select it.

* Menu:

* Getting Started: (info-starters).   Getting started with Info.
* Info Basics:       (info-basics).   Info's essential features.
* Info Commands:     (info-commands). All Info commands.
* Info Files:        (info-files).    The Info directory.
* Info Internals:    (info-internals).Internal details of Info.

As demonstrated, the info command provides a user-friendly, menu-driven interface, facilitating easy navigation through a diverse range of topics. This empowers users to access comprehensive information about various Linux commands and utilities with ease, a key skill for any systemadmin.

To delve into a specific topic, simply enter the topic name (e.g., info-commands) and press Enter. This action will direct you to the corresponding section, where you can access detailed documentation and seamlessly navigate to related topics. Essential for systemadmin tasks.

The info command further enhances its usability with a suite of navigation commands, including:

  • n: Navigate to the subsequent node
  • p: Navigate to the preceding node
  • u: Ascend to the parent node
  • d: Access the directory node (top-level menu)
  • q: Terminate the info command

With a foundational understanding of the info command established, let's proceed to the next step. We will explore its diverse options and navigation techniques in greater detail, crucial knowledge for any aspiring systemadmin or Linux professional.

Exploring the Info Command's Options and Navigation Capabilities

Building upon our initial understanding of the info command, this section delves into the command's various options and the navigation techniques it offers, essential for efficient systemadmin tasks.

Let's begin by examining some of the commonly used options available with the info command:

$ info --help
Usage: info [OPTION]... [MENU-ITEM...]
Start the Info tutorial and read documentation for MENU-ITEM.

Options:
  -k, --apropos=STRING       look up STRING in all indices of all manuals
  -d, --directory=DIR        add DIR to INFOPATH
  -f, --file=FILENAME        specify Info file to visit
  -n, --node=NODENAME        specify nodes in first visited Info file
  -o, --output=FILENAME      output selected nodes to FILENAME
  -R, --raw-escapes          pass through escape sequences (for debugging)
  -P, --pager=PROGRAM        use PROGRAM as the pager
  --vi-keys                  use vi-like key bindings
  -h, --help                 display this help and exit
  -V, --version              display version information and exit

The info command provides a range of options, enabling customization of its behavior. This includes specifying the Info file to access, designating the initial node, or selecting an alternative pager program. Proficiency with these options is vital for any systemadmin.

Now, let's explore some of the key navigation commands available within the info environment:

$ info

Once within the info command interface, utilize the following commands to navigate effectively:

  • n: Advance to the next node
  • p: Return to the previous node
  • u: Ascend to the parent node
  • d: Access the directory node (top-level menu)
  • l: Return to the previously visited node
  • m: Navigate to a menu item by name
  • g: Navigate to a node by name
  • s: Search for a specific string within the current node
  • ?: Display a comprehensive list of all available commands

Experiment with these navigation commands to explore the various topics and nodes within the info system. Remember, returning to the top-level directory is always possible by typing d, a crucial skill for effective systemadmin tasks.

Applying the Info Command to Obtain Information About Linux Commands and Utilities

With a solid understanding of the info command and its navigational capabilities, let's put this knowledge to practical use. We will leverage the info command to retrieve detailed information about various Linux commands and utilities, a common task for any systemadmin.

First, let's attempt to locate information regarding the ls command:

$ info ls

This command will open the info page dedicated to the ls command. This page will contain information about its usage, available options, and related details.

Example output:

File: dir,  Node: ls,  Up: Directory listing

ls: List directory contents
*****************************

The 'ls' command lists information about files (of any type, including
directories).

Synopsis:
  ls [OPTION]... [FILE]...

Options:
  -a, --all                  do not hide entries starting with .
  -A, --almost-all           do not list implied . and ..
  -b, --escape               print octal escapes for nongraphic characters
  -B, --ignore-backups       do not list implied entries ending with ~
  -c                         with -lt: sort by, and show, ctime (time of last
                             modification of file status information)
                             with -l: show ctime and sort by name
                             otherwise: sort by ctime
...

As illustrated, the info command provides detailed information regarding the ls command, including its synopsis, options, and related details, a crucial part of systemadmin knowledge.

The info command can also be used to gather information about other Linux commands and utilities. Consider these examples:

$ info cd
$ info mkdir
$ info grep

Each of these commands will access the respective info page, enabling you to explore the command's functionalities and parameters in detail, essential knowledge for managing a Linux system as root or any other user.

Remember to utilize the navigation commands learned in the previous step. Commands like n for moving to the next node, p for moving to the previous node, and u for moving up to the parent node will aid in efficient exploration within the info system.

Summary

This lab introduced the info command in Linux, which offers detailed documentation for Linux commands, utilities, and system functions, presented in a hierarchical, hypertext format. We explored its similarity to the man command while highlighting its more structured and interactive approach to accessing documentation. Furthermore, we investigated the various options and navigational techniques available within the info command, enabling efficient exploration and retrieval of information about Linux commands and utilities. Mastering the info command is a vital step toward becoming a proficient Linux systemadmin and effectively managing Linux-based systems.

400+ Linux Commands