In this article I will explain how to get help on the command line. It’s a basic skill that everyone needs to learn once they set out to master the shell.
If you are using Mac or Linux, then this article contains everything you need to know to browse the built-in help pages for all those “command-line commands” =D like
The quickest and briefest way to read the help for a shell command is to type
<command> --help where in place of
<command> you substitute the name of the actual unix command that you want to know about.
$ ls --help ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
<command> --help will print a short block of text that shows what parameters and options a command can take.
Unfortunately shell commands aren’t standardized in this regard so if
<command> --help doesn’t work, you will have to try the following variations, one of which should work instead:
<command> -h <command> -help
However the “short help” is only helpful if you know what the command does and what the common use cases are. That information is to be found in the manpage.Reading the manpage
Then use the arrow keys to move up and down.
SHIFT + OPTION + <
to go to the top of the page. Type
SHIFT + OPTION + >
to go to the bottom of the page.
q to quit.
- type the string you want to search for and hit ENTER
nto go the next match
pto go to the previous match
And don’t forget to read