Saturday, April 14, 2007

1.1 RTFM

Command Line Interface (BASH Shell)
1.1 RTFM

RTFM (Read the F@*%^#& Manual) was the first thing I learned about Unix and it's served me well on Linux. Almost every Linux command has a manual entry that's accessible through the command line. The command looks like this:
user@linux:~> man "command-name"

This will bring up the manual entry for a particular command. Which has an explanation of what the command does and the syntax of how to use it.

This is the first part of the manual entry for the "man" command.

MAN(1) Manual pager utils MAN(1)

NAME
man - an interface to the on-line reference manuals

SYNOPSIS
man [-c|-w|-tZ] [-H[browser]] [-T[device]] [-adhu7V] [-i|-I] [-m sys‐
tem[,...]] [-L locale] [-p string] [-C file] [-M path] [-P pager] [-r
prompt] [-S list] [-e extension] [[section] page ...] ...
man -l [-7] [-tZ] [-H[browser]] [-T[device]] [-p string] [-P pager] [-r
prompt] file ...
man -k [apropos options] regexp ...
man -f [whatis options] page ...

DESCRIPTION
man is the system's manual pager. Each page argument given to man is
normally the name of a program, utility or function. The manual page
associated with each of these arguments is then found and displayed. A
section, if provided, will direct man to look only in that section of
the manual. The default action is to search in all of the available
sections, following a pre-defined order and to show only the first page
Manual page man(1) line 1


As you can see the manual command reformatted the whole terminal window. So the first question is how do you quit?

To Quit press Q.
This is not intuitive at all and surprisingly missing from a lot of dead-tree resource manuals. To Interrupt press Ctrl-Z. This will halt the process but wont quit. I'm sure there is a way to restart the process but I haven't found it yet.

To access help press H.
This has a list of what all the keys do when pressed. Very useful.

To Navigate the manual entry:
To go down or up on the manual entry you can use the arrow keys or Page Up and Page Down keys.
Pressing W is the same as Page Up, pressing F as Page Down and Pressing E and Y the same as the arrow key down and up (respectively) if you have a limited keyboard.

Now you should read the manual entry for "man" and learn about the syntax of commands as explained by man.

Typing the command with the flag -? or -h will sometimes bring a different manual entry on the command.
There is also an "info" command that works the same way as the manual "man" command.

No comments: