Command Line Interface
Volume Number: 16
Issue Number: 10
Column Tag: Mac OS X
An Intro to Mac OS X's Command Line Interface
by Andrew C. Stone
Back in the mid to late eighties, DOS was king and PC users would make fun of the
"MacInToy" simply because it had no expert command line interface (CLI). Of course,
this was before the PC world ditched their own command line interface in favor of an
uglied-down graphical user interface that poorly copied the Macintosh's finely detailed
GUI. Being an old Unix weenie from the academic Computer Science scene, I can
understand the argument that the command line is an extremely powerful tool for
expert users and programmers. Of course I also understand that it needs to be hidden
from the casual user, lest they type "rm -rf /" as root and totally erase their hard
disk!
And now, the CLI is just one more compelling feature of Mac OS X. OS X is based on
Darwin, Apple's version of the open source FreeBSD 3.x combined with the Carnegie
Melon University Mach 3.x kernel. The command line and all the standard Unix
utilities are part and parcel of the developer distribution. While it is still not clear
what will or won't ship to the end user in the final OS X, DP4 gives you Terminal.app
(/System/Administration/Terminal.app) to provide a "shell" allowing you to type
commands directly to the computer for both interactive and batch processing. This
article is an introduction into the use of the command line, and I hope to provide
enough information to convince unrepentent GUI freaks that a CLI is indeed useful, and
share some cool tricks, tips and information on where to go to learn more.
She Sells C-shells
Once upon a time, there was just the c-shell, /bin/csh. However, Unix hackers love to
cram more and more features into any one given program, so now there are several
shell programs to pick from, including: tcsh, csh, zsh and bash. When you
double-click Terminal.app to launch a shell, Terminal uses your default shell as the
command line interface. In a standard installation, the default shell is tcsh. Your
default shell is stored in NetInfo, and can be set by editing the User in