• We had to restore from a backup today after a failed software update. Backup was from 0000 EDT and restored it at 0800 EDT so we lost about 8hrs. Today is 07/20/2024. More info here.

Linux+: Linux Shell 12 – Shell Commands Help - Info


Jarret W. Buse

Linux+: Linux Shell 12 – Shell Commands Help - Info

As we have seen in the previous article, one way to get shell command help is through the man pages. The second way is through the information (info) pages.

Info was created by the Free Software Foundation (FSF) as hypertext documents that included more information than the man pages, which some do have more information.

The syntax for the info command is:

info [options] command

The simplest way to look up a command is to use no options. For example, to look up more information on the command 'ls', you would enter:

info ls

The options for the info command are:

  • -d (--directory=DIR) – Adds DIR to INFOPATH to allow DIR to be searched for info pages
info -d ~/info/

NOTE: The environment variable $INFOPATH contains the path list to search for info pages.

  • --dribble=FILENAME – Keeps user keystrokes in FILENAME
info --dribble \home\jarret\ls-out ls

NOTE: Be sure to edit the output file and remove the the last command of 'q', if it was recorded. There should also be a 'box' before the 'q' which should also be removed. If it is not removed and you use the recorded keystrokes with --restore, it will also quit the info command.

  • -f (--file=MANUAL) – Specifies the manual to visit
info --file=/etc/sys.info

NOTE: The command and options load the specified info file if it exists.

  • -h (--help) – Displays help information for the info command

info -h

  • --index-search=STRING – go to a point in page which has matching STRING

info --index-search=”author” ls

NOTE: This is like using CTRL+F in a program to find specific words. The first line is found with a matching STRING and then the ',' can be used to find the next match.

  • -k (--apropos=STRING) – Looks through all indexes of all manuals for STRING

info -k ”mkdir”

NOTE: The output will show the file in parenthesis, like '(coreutils)' and then a section with a dash followed by the command being searched. The file can be used with the -f or --file command.

  • -n (--node=NODENAME) – Specifies nodes in first visited info page
  • --no-raw-escapes – Outputs escapes as text
  • -o (--output=FILE) – Output selected node to designated FILE

info -o “/home/jarret/ls.txt” ls

  • -O (--show-options, --Usage) – Uses command-line mode
  • -R (--recursive) – Lists content directories recursively
  • --raw-escapes – Outputs ANSI escapes (default)
  • --restore=FILE – Read keystrokes from FILE made with –dribble option

info --restore \home\jarret\ls-out ls

NOTE: Be sure to remove the last command from the output file. Otherwise, when you run the command, you will be back at the prompt since info processes the 'q' key and quits.

  • --strict-node-location – Info pointers are used as-is (debugging purposes)
  • --subnodes – Outputs menu items in a recursive fashion
  • -v (--variable VAR=VALUE) – Assigns VALUE to Info variable VAR
  • --version – Displays the version of info command
  • --vi-keys – Uses the vi-like and less-like key bindings
  • -w (--where, --location) – Displays location of all Info files containing a keyword

info -w ls

  • -x (--debug=NUMBER) – Specifies debugging level (-1 for all)

Some of the keystrokes usable within info are as follows:

  • x – Closes the help window
  • q – Quit Info
  • H – Invoke the Info tutorial
  • Up – Move up one line
  • Down – Move down one line
  • DEL – Scroll backward one full screen
  • SPC – Scroll forward one full screen
  • Home – Go to the beginning of this node
  • End – Go to the end of this node
  • TAB – Skip to the next hypertext link
  • RET – Follow the hypertext link under the cursor
  • l – Go back to the last node seen in this window
  • [ – Go to the previous node in the document
  • ] – Go to the next node in the document
  • p – Go to the previous node on this level
  • n – Go to the next node on this level
  • u – Go up one level
  • t – Go to the top node of this document
  • d – Go to the main 'directory' node
  • 1...9 – Pick the first...ninth item in this node's menu
  • 0 – Pick the last item in this node's menu
  • m – Pick a menu item specified by name
  • r – Follow a cross reference specified by name
  • g – Go to a node specified by name
  • s– Search forward for a specified string
  • { – Search for previous occurrence
  • } – Search for next occurrence
  • i – Search for a specified string in the index, and select the node referenced by the first entry found
  • Ctrl-g – Cancel the current operation


  • slide.jpg
    49.4 KB · Views: 116,362

Members online