5 Ways to Get Help in the Command Line of Mac OS X
Whether you’re a unix novice or veteran to the terminal, if you’re using the command line you’ll often find yourself looking up exactly how to use a specific command for either its understanding the commands full functionality or just to discover the proper syntax. Many of us will just google a command if we can’t seem to get things to work properly, but before you go that route you can also try the available resources that are built right in to the Terminal.
There’s no shame in needing assistance or needing to reference a manual page, so here are five ways to get some help right in the command line of OS X. Because most of these tricks are native to the command line and not OS X specific, they will work on a Mac and many other unix variations too, like Linux.
5 Tricks to Get Instant Command Line Help in the Mac OS X Terminal
|Command||Action / Results|
||Display the manual page for (command). eg: man lsof|
||Display a one line brief summary of specified command. eg: whatis lsof||
||Display command usage information including available flags and proper syntax. eg: lsof –help||
||Searches the whatis database for (string), helpful in finding commands. eg: apropos ssh||
||Begin typing a command, and hit the tab key to autocomplete, or to list available commands that start with the typed prefix.|
Note: be sure to remove the parenthesis () to get each command to work properly.
In all versions of unix, man(manual) pages are legitimately useful resources, particularly to obtain a broad understanding of a specific command when the –help flag trick isn’t sufficient, or apropos is too brief.
Now, the next time your geeky coworker tells you to “RTFM”, you can school them on your knowledge that you learned from the builtin terminal resources.
Do you have another trick to get help in the OS X Terminal? Do you use man pages or the –help flag? Or maybe you just google the web for your question or problem like many of us tech workers do? They’re all valid tricks, but the advantage to those mentioned above is that they work offline too, which can be really handy in many situations. And for those interested in learning more about the command line in OS X, we have plenty of Terminal tips here!