Chapter 6 Getting help in Linux!

Linux provides help to its users to have a better experience . It helps the users in how to implement the commands, its usage, its format , its function etc.

The several helps available helps are:-

  • -h or –help
  • whatis ,makewhatis, apropos
  • man , info
  • /usr/share/doc
  • /usr/share/doc/howto/en
  • TLDP
  • GUI based help by various distros

-h or –help :-
command [options] [arguments]
commands like ls, cat, man
Significance of space

Word options and Single letter options , – and –

arguments a.k.a parameters

whatis:-

whatis searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output. Only complete word matches are displayed. The whatis database is created using the command makewhatis. Closely related commands include apropos and man

$whatis whatis:-
whatis               (1)  – search the whatis database for complete words

apropos :- The Underutilized Linux Command!! When you dont remember the command to use.

$whatis apropos:-

apropos              (1)  – search the whatis database for strings

What is the difference between whatis and apropos

whatis searches  a set of database files containing short descriptions of system commands for keywords and displays the result on the standard  output.  Only complete word matches are displayed.

apropos searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output.

apropos -> man -k
whatis -> man -f

Man:-
Man – manual

  • man -S 5 command or man 5 command
  • The less command is internally used to display ‘man’ pages
  • The up and down arrow and other navigation keys may be used to move around the help page
  • Pressing the ‘q’ key will ‘quit’ the page and bring up the command prompt again.

Structure of Man pages:-

NAME – Name of the command – short description which make to the whatis DB.
SYNOPSIS – Give a short overview on available program options. For functions this sections lists corresponding include files and the prototype so the programmer knows the type and number of arguments as well as the return type.
DESCRIPTION – Detailed overview of the command and the purport of each of its ‘-’ options and other command line parameters.
OPTIONS – A description of how each option affects program behaviour.
COMMANDS – Instruction that can be given to the program while it is running
FILES – Lists configuration files, startup files, and files the program directly operates on
ENVIRONMENT – Lists all environment variables that affect your program or function
DIAGNOSTICS – Posible Error messages displayed in the program.
EXAMPLE – Example Usage of the command
BUGS and AUTHOR section – used only by brave developers
SEE ALSO – Lists related man-pages and additional documentation.

Man Sections:-

  1. – User commands – ls, bash
  2. – Library functions related to system Calls – syscall, pipe
  3. – Other Library Functions – perror, strerror, errno (libc calls)
  4. – Special Files or Devices – null, mem
  5. – File Formats – aliases, man.config
  6. – Games -
  7. – Conventions and explanations – boot, bootparam
  8. – Administration and privileged commands – mkfs, ifconfig
  9. – Kernel
  10. L – Math library functions
  11. N – tcl functions

Info :- Not all commands have info. Info has more description and don’t cover all the options for a command. Use info and man together to understand a command completely

/usr/share/doc – Documentation that comes with individual packages. It has FAQ and other details like README, LICENSE

/usr/share/doc/howto/en – Sometimes howtos will be missing. It is the TLDP howtos in most cases.

TLDP :- The Linux Documentation Project – Has documentation on all topics about Linux, you will ever mess with !!

Related posts:

  1. Chapter 7 Basic Commands in Linux.
  2. Chapter 9 Advanced Linux commands!
  3. Chapter 8 File types in Linux.
  4. Chapter 4 Basic principles in Linux!
  5. Chapter 10 Editing files in Linux.

Comment Form

About this blog

This blog, acts as a knowledge repository for the world and is unofficial! Anything we find interesting in the cyber world will go here. Most cases, this blog will reflect the happiness of our staff in reaching successful solution to an issue (s)he worked on. A reference for other fellow SAGEs who come across similar issues later