How to obtain help on a command-line tools

This post may appeared a little bit too simple to some of you, but yes, beginner(as we all has been) may need such information.
I see 2 ways to obtain off-line help on a program:

  1. Use help option of the program itself.
  2. Use the man page.

You may able to access to any command-line help by using the option –help like
myprogramname --help
It will display the information on the program options then return to the prompt.

as sample:
nowin:~ # uname --help
Usage: uname [OPTION]...
Print certain system information.  With no OPTION, same as -s.

  -a, --all                print all information, in the following order,
                             except omit -p and -i if unknown:
  -s, --kernel-name        print the kernel name
  -n, --nodename           print the network node hostname
  -r, --kernel-release     print the kernel release
  -v, --kernel-version     print the kernel version
  -m, --machine            print the machine hardware name
  -p, --processor          print the processor type or "unknown"
  -i, --hardware-platform  print the hardware platform or "unknown"
  -o, --operating-system   print the operating system
      --help     display this help and exit
      --version  output version information and exit

Report bugs to .

The second solution is using man (manual pages) page program, that will provide more detailed information on how to use the program. This will open a distribution level pre-installed documentation.
man myprogramname

in our sample:
nowin:~ # man uname
Man: find all matching manual pages
 * uname (1)
   uname (2)
   uname (1p)
   uname (3p)
Man: What manual page do you want?
Man: 1
       -p, --processor
              print the processor type or "unknown"

       -i, --hardware-platform
              print the hardware platform or "unknown"

       -o, --operating-system
              print the operating system

       --help display this help and exit

       --version
              output version information and exit

AUTHOR
       Written by David MacKenzie.

REPORTING BUGS
       Report bugs to .

COPYRIGHT
       Copyright   ©   2008   Free   Software   Foundation,  Inc.   License  GPLv3+:  GNU  GPL  version  3  or  later
      
       This is free software: you are free to change and redistribute it.  There is NO WARRANTY, to the  extent  per-
       mitted by law.

SEE ALSO
       arch(1), uname(2)

       The  full documentation for uname is maintained as a Texinfo manual.  If the info and uname programs are prop-
       erly installed at your site, the command

              info coreutils 'uname invocation'

       should give you access to the complete manual.

GNU coreutils 6.12                                  December 2008                                            UNAME(1)
 Manual page uname(1) line 32/70 (END)

You can navigate on the manual using “Page Up” and “Page Down” and “q” to quit the manual.

So, at now, you can’t say “i didn’t knew” there is at least one page on that topic 😉

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: