Let us look at various ways to get help for linux commands:
- The ‘man’ Command
Linux provides a built-in manual system known as ‘man’ (short for “manual”) that’s your first stop for comprehensive command information. Upon installing a package, its man pages are also created in /usr/share/man directory. Simply type ‘man’ followed by the command you want to learn about. For instance, if you want to know more about the ‘ls’ command, type:
man ls
This will provide you with a detailed manual page explaining the command’s usage, options, and examples.
Using man -k keyword
- The ‘–help’ Option
Many Linux commands also offer a ‘–help’ option that provides a concise summary of the command’s functionality and available options. To access this information, simply append ‘–help’ to the command. For example:
ls --help
This quick reference is especially handy when you need a brief overview of a command without diving into the extensive 'man' page.
- The ‘whatis’ Command
The ‘whatis’ command is a valuable tool for obtaining a brief description of a command. It’s especially helpful when you only need a quick summary. To use it, simply type ‘whatis’ followed by the command you’re interested in:
whatis ls
The 'whatis' command will provide a short one-liner description of the specified command.