Sponsors

Apple Store

Visit the official Apple Store to buy a Mac online. Free shipping!



Editors' Picks


Comments

Contact Us

Search

Top Posts

Categories

Recent Posts

Our Feeds


Five ways to get help in the Mac OS X Command Line

Whether you’re a unix novice or veteran, if you’re using the command line you’ll often find yourself looking up exactly how to use a specific command for either its full functionality or 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 should try the available resources that are built right in. There’s no shame in needing assistance, so here are five ways to get help in the command line:

Command Action / Results
man (command) Display the manual page for (command). eg: man lsof
whatis (command) Display a one line brief summary of specified command. eg: whatis lsof
(command) --help Display command usage information including available flags and proper syntax. eg: lsof –help
apropos (string) Searches the whatis database for (string), helpful in finding commands. eg: apropos ssh
(command)+tab key 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.

Digg!


Social bookmarks:


Comments:

Comments: 3

Comment from Island in the Net
Time: February 24, 2007, 8:21 am

You forgot : info

INFO(1) User Commands INFO(1)

NAME
info - read Info documents

SYNOPSIS
info [OPTION]… [MENU-ITEM…]

DESCRIPTION
Read documentation in Info format.

EXAMPLES
info show top-level dir menu

info emacs
start at emacs node from top-level dir

info emacs buffers
start at buffers node within emacs manual

info –show-options emacs
start at node with emacs’ command line options

info -f ./foo.info
show file ./foo.info, not searching dir

Comment from jared
Time: February 24, 2007, 8:52 pm

that is great so is the info command but I don’t understand the purpose of apropos and what it possibly does

Comment from Chris
Time: February 26, 2007, 1:31 am

Let’s say you’re programming and need to look up information regarding sockets, but socket(3) didn’t provide the information you are looking for.

Doing ‘apropos socket’ will get you a list of _all_ manual pages talking about sockets, like accept(3), bind(3) and connect(3).

Write a comment





February 24th, 2007