Help Command
When you need assistance with Linux commands, there are several built-in help options available that will provide you a quick reference or detailed information about command usage.
Using the whatis Command
The whatis command provides a brief description of a command. To use it, simply type whatis followed by the command name. For example:
karchunt@kcserver:~$ whatis ls
ls (1) - list directory contentsUsing the man Command
The man command displays the manual pages for a command, providing detailed information about its usage, options, and examples. To access the manual for a command, type man followed by the command name. For example:
karchunt@kcserver:~$ man ls
LS(1) User Commands LS(1)
NAME
ls - list directory contents
SYNOPSIS
ls [OPTION]... [FILE]...
DESCRIPTION
List information about the FILEs (the current directory by default). Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
-a, --all
do not ignore entries starting with .
...Using the --help Option
Most Linux commands support the --help option, which provides a summary of the command’s usage and available options. To use it, type the command followed by --help or -h. For example:
karchunt@kcserver:~$ ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
--author with -l, print the author of each file
-b, --escape print C-style escapes for nongraphic characters
--block-size=SIZE with -l, scale sizes by SIZE when printing them;
e.g., '--block-size=M'; see SIZE format below
...Searching with apropos
The apropos command searches the manual page names and descriptions for a specified keyword. This is useful when you are unsure of the exact command name. For example:
karchunt@kcserver:~$ apropos copy
cp (1) - copy files and directories
cpgr (8) - copy with locking the given file to the password or group file
cppw (8) - copy with locking the given file to the password or group file
dd (1) - convert and copy a file
debconf-copydb (1) - copy a debconf database
git-checkout-index (1) - Copy files from the index to the working tree
install (1) - copy files and set attributes
objcopy (1) - copy and translate object files
rsync (1) - a fast, versatile, remote (and local) file-copying tool
scp (1) - OpenSSH secure file copy
ssh-copy-id (1) - use locally available keys to authorise logins on a remote machine
string_copying (7) - copying strings and character sequences
x86_64-linux-gnu-objcopy (1) - copy and translate object files