Datasheet
The system library takes the form of a dynamic library installed as /usr/lib/libSystem.B.dylib.
Mac OS X also includes a framework called
System.framework in /System/Library/Frameworks
that refers to this library. The files that define the Darwin interface live in the /usr/include directory.
By the way, neither of these directories is visible from Finder; Mac OS X actively hides much of the com-
plexity of Darwin from the average Mac user.
Unix Commands
Unix users interact with their systems using command-line tools. These tools typically perform very spe-
cialized functions, such as listing files in a directory or displaying files on-screen. The advantage of sup-
plying many specialized tools lies in the way commands can be combined to form more sophisticated
commands. For example, a command that lists the contents of a directory can be combined with a pro-
gram that lists text in “pages” for easy reading.
As you have learned, you use the Terminal application to gain access to Darwin’s command-line tools.
The following Try It Out looks at Darwin’s command-line interface. You start by browsing files using the
command-line, looking up command information in Darwin’s online help system, and running a com-
mand that displays its own arguments.
Try It Out Experiencing Darwin’s Command-Line Interface
1.
Before you get started, you need to make sure the command-line tools have been installed on
your system. Although Mac OS X comes with a full set of Unix commands, they are an optional
part of the install process. Using the Finder, make sure a folder named
BSD.pkg exists in the
/Library/Receipts directory. If it does, you can move directly to step 3. Otherwise, continue
to the next step.
2. Insert the first Mac OS X Installation CD and run the installer. From there you can customize
your install and select only the
BSD.pkg. When the installer finishes, you are ready to proceed.
3. In the Finder, go to Applications➪ Utilities and launch the Terminal application. You will see a
few status lines of text ending in a command-line prompt (your lines may look slightly different
than what is shown here):
Last login: Sat May 15 23:28:46 on ttyp1
Welcome to Darwin!
Macintosh:~ sample $
4. When using Terminal there are commands that let you navigate the file system. The Terminal
application always keeps track of where you are, maintaining the notion of your current directory.
You can display the contents of the current directory using the
ls (list) command that follows. As
a matter of fact, the Terminal window is currently “in” your home directory. Your results may
vary from what’s printed here, but they will match what you see in the Finder when you browse
your home directory. (Throughout this book, any text you are asked to type on the command line
is indicated in bold.)
Macintosh:~ sample $ ls
Desktop Library Music Public
Documents Movies Pictures Sites
9
The Mac OS X Environment
05_573993 ch01.qxd 6/16/05 2:22 PM Page 9