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.

300<br />

CHAPTER 18 INTRODUCING DARWIN AND THE SHELL<br />

Oops, first we need to remove any files in there:<br />

<strong>Leopard</strong>:~/Documents/Shakespeare scott$ rm <strong>Mac</strong>beth/*<br />

<strong>Leopard</strong>:~/Documents/Shakespeare scott$ rmdir <strong>Mac</strong>beth<br />

<strong>Leopard</strong>:~/Documents/Shakespeare scott$ ls<br />

tomorrow<br />

Next, we can create an empty file with touch:<br />

<strong>Leopard</strong>:~/Documents/Shakespeare scott$ touch nothing<br />

<strong>Leopard</strong>:~/Documents/Shakespeare scott$ ls<br />

nothing tomorrow<br />

<strong>Leopard</strong>:~/Documents/Shakespeare scott$ cat nothing<br />

<strong>Leopard</strong>:~/Documents/Shakespeare scott$<br />

More Essential Commands<br />

There are literally hundreds of commands available at the command line, and it would take far<br />

more space than we have in this book to cover them all; however, as you progress through the<br />

rest of the book, you will learn a number of new commands when they are applicable to the<br />

topic at hand. In the meantime, there are a number of essential, or at least very useful, commands<br />

that you may want to know about that don’t fit nicely in a future discussion in this book. They<br />

are covered here.<br />

man<br />

The man command is the command that will explain all others. If you want to learn more about<br />

the ls command, enter man ls, and your terminal will open into a special mode (called a pager)<br />

for reading man pages, which will look something like this:<br />

LS(1) BSD General Commands Manual LS(1)<br />

NAME<br />

ls -- list directory contents<br />

SYNOPSIS<br />

ls [-ABCFGHLPRTWZabcdefghiklmnopqrstuwx1] [file ...]<br />

DESCRIPTION<br />

For each operand that names a file of a type other than directory, ls<br />

displays its name as well as any requested, associated information. For<br />

each operand that names a file of type directory, ls displays the names<br />

of files contained within that directory, as well as any requested, associated<br />

information.<br />

:<br />

If no operands are given, the contents of the current directory are displayed.<br />

If more than one operand is given, nondirectory operands are<br />

displayed first; directory and nondirectory operands are sorted separately<br />

and in lexicographical order.<br />

The following options are available:<br />

-@ Display extended attribute keys and sizes.

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

Saved successfully!

Ooh no, something went wrong!