Linux how to: Accessing documentation

Linux offers many helpful commands for accessing its documentation. Here's a quick guide.

By ITworld tips  1 comment

by Matthew Helmke - Linux, like Unix, is a self-documenting system, with man pages accessible through the man command. But Linux also offers many other helpful commands for accessing its documentation. You can use the apropos command--for example, with a keyword such as partition--to find commands related to partitioning, like this:

$ apropos partition 
diskdumpfmt          (8)  - format a dump device or a partition 
fdisk                (8)  - Partition table manipulator for Linux 
GNU Parted [parted]  (8)  - a partition manipulation program 
mpartition           (1)  - partition an MSDOS hard disk 
MPI_Cart_sub         (3)  - Partitions a communicator into subgroups which form  
                            lower-dimensional cartesian subgrids 
partprobe            (8)  - inform the OS of partition table changes 
pvcreate             (8)  - initialize a disk or partition for use by LVM 
sfdisk               (8)  - Partition table manipulator for Linux 

[ See also: Unix How To: Repeating Commands in Bash ]

To find a command and its documentation, you can use the whereis command. For example, if you are looking for the fdisk command, you can do this:

$ whereis fdisk
fdisk: /sbin/fdisk /usr/share/man/man8/fdisk.8.gz

Using Man Pages

To learn more about a command or program, use the man command, followed by the name of the command. Man pages for Linux and X Window commands are within the /usr/share/man, /usr/local/share/man, and /usr/X11R6/man directories; so, for example, to read the rm command's man page, use the man command like this:

$ man rm

[ See also: Favorite Unix Tools & Commands ]

After you press Enter, the less command (a Linux command known as a pager) displays the man page. The less command is a text browser you can use to scroll forward and backward (even sideways) through the document to learn more about the command. Type the letter h to get help, use the forward slash / to enter a search string, or press q to quit.

Note

Although nearly all the hundreds of GNU commands included with Linux each have a man page, you must use the info command to read detailed information about using a GNU command. For example, to learn even more about bash (which has a rather extensive manual page), use the info command like this:

$ info bash

Press the n and p keys to navigate through the document, or scroll down to a menu item on the screen and press Enter to read about a specific feature. Press q to quit reading.

__________________

Ubuntu Unleashed

This tip is adapted by Matthew Helmke as based on the book, Ubuntu Unleashed: 2010 Edition (covering 9.10 and 10.4), authored by Andrew Hudson, Paul Hudson, Matthew Helmke and Ryan Troy, ISBN 0672331098, published by SAMS Dec. 2009, Copyright 2010 by SAMS Publishing.

For a complete table of contents, please visit: www.informit.com/title/0672331098

Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.

1 comment

    Anonymous 2 years ago
    Matthew,Good article! Thanks! I posted a similar tip to my Unix User Tips page several years ago, but I forgot to mentioninfo. You might also want to mention these: which, where, whatis, find, locate. See: http://bristle.com/Tips/Unix.htm#help--Fred Stluka

      Add a comment

      Post a comment using one of these accounts
      Or join now
      At least 6 characters

      Note: Comment will appear soon after you have activated your account.
      Obscene/spam comments will be removed and accounts suspended.
      The information you submit is subject to our Privacy Policy and Terms of Service.

      ITworld LIVE

      Operating SystemsWhite Papers & Webcasts

      White Paper

      Microsoft Enterprise Agreement Program Overview

      Discover how flexible the Microsoft Enterprise Agreement Program is to help you build the right software solution agreement for your business. This paper highlights all the available options-from on-premise software and cloud service solutions, to payment options and enrollment programs, and more.

      White Paper

      Watson - A System Designed for Answers. The future of workload optimized systems design

      Watson is a workload optimized system designed for complex analytics, made possible by integrating massively parallel POWER7 processors and DeepQA technology. Read the white paper about Watson's workload optimized system design.

      See more White Papers | Webcasts

      Ask a question

      Ask a Question