Datasheet
If no operands are given, the contents of the current directory are dis-
played. If more than one operand is given, non-directory operands are
displayed first; directory and non-directory operands are sorted sepa-
rately and in lexicographical order.
The following options are available:
-A List all entries except for . and ... Always set for the super-
:
8. The arguments you are allowed to pass to a Unix command depend entirely on the command.
As you have seen, the
ls command accepts file names, and the man command accepts the
names of other Unix commands. The
echo command accepts arbitrary arguments and simply
repeats them on the screen. It turns out that this command is especially useful when writing
shell scripts, as you see in Chapter 10.
Macintosh:~ sample$ echo hello, my name is sample
hello, my name is sample
How It Works
In spite of appearances, Terminal doesn’t understand any of the commands you just entered. In fact,
Terminal’s only job is to read input from your keyboard and display text coming from a special program
called a shell. Terminal starts your shell for you when its window appears. The shell is a special program
that provides a command-line prompt, parses instructions into command names and lists of arguments,
runs the requested commands, and passes back the resulting text.
Once the shell has decided which command to launch, the shell starts that command and passes the
remaining flags and arguments into the command for further evaluation. That’s why
ls, man, and echo
all interpret their arguments in different ways. Flags are also interpreted by individual commands, so it’s
not uncommon to use a particular flag in more than one Unix command, although the flag might have
different meanings.
One thing to watch out for: Unix shells historically are case-sensitive, meaning that the command
LS is
not the same as
ls, the directory library is not the same as the directory Library, and so on. Mac OS
X’s default file system, HFS+, is case-insensitive, and much of the time the shell can figure out what you
mean. But if you had some trouble with the commands in the preceding Try It Out, make sure you
entered the text exactly as it appears here.
You have only just scratched the surface of what the shell can do. You will continue to learn more about
the shell as you continue through the book.
Graphics and Media Layers
Much of the user experience on Mac OS X is built around graphics. All the elements you see on the
screen— windows, menus, buttons, text — are graphics. It comes as no surprise that Mac OS X has sev-
eral subsystems dedicated to graphics, as shown in Figure 1-4.
11
The Mac OS X Environment
05_573993 ch01.qxd 6/16/05 2:22 PM Page 11