05.01.2013 Views

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

Mac OS X Leopard - ARCAism

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

290<br />

CHAPTER 18 INTRODUCING DARWIN AND THE SHELL<br />

Darwin Basics<br />

The first thing you need to know when working with Darwin is some of the common language<br />

used, in order to avoid confusion. Second, you need to know how files are organized; and finally,<br />

you need to know how to move around the file system.<br />

NOTE When we talk about files here, we are not just talking about the last text file you created;<br />

Darwin treats everything as a file. For example, a directory (a.k.a. folder) is a file that<br />

contains other files. Each file has a number of properties that will determine how the shell<br />

treats that specific file; if it’s an application, the shell will launch it; if it’s a directory, the shell<br />

will know that it can access other files contained in it. We’ll cover file properties a bit later.<br />

Darwin Semantics<br />

To avoid confusion as the chapter proceeds, we should quickly go over some of the important<br />

terms used in Darwin and how they compare with terms used in the Finder. Table 18-1 defines a<br />

handful of terms used commonly in Darwin (and other UNIX systems), gives the Finder equivalent<br />

or alternate term, and adds any relevant notes. While there are many other terms you’ll<br />

come across, these basics will be used repeatedly, so they are good to know.<br />

Table 18-1. Darwin Terms Explained<br />

Finder or<br />

Darwin Term Alternate Term Notes<br />

File File (and others) Darwin treats all items, documents, directories,<br />

and applications as files; in the Finder, when we<br />

talk about a file, we are generally talking<br />

specifically about a document.<br />

Directory Folder Folders are generally referred to as directories.<br />

Root directory, or / Top level of hard drive Not to be confused with the root user, the root<br />

directory, which is represented by the / symbol, is<br />

the highest level of the Darwin file structure.<br />

Root (user) Administrator In addition to the root directory, there is also<br />

a root user. The root user (also known as the<br />

superuser) has the ability to do just about<br />

anything in the Darwin environment, including<br />

irreparably destroying it. To maintain a secure<br />

system and avoid devastating problems, certain<br />

files require root privileges to read, write, and<br />

execute. While the administrator is the closest<br />

thing to root in Aqua, it’s not quite the same, as<br />

root actually has more abilities.<br />

Link (specifically a Alias A link in Darwin functions the same way as an<br />

symbolic link) alias does in the Finder (and appears as such<br />

when viewed in the Finder). While the function<br />

of a symbolic link and an alias are the same, it’s<br />

worth knowing that they are implemented<br />

differently.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!