Cover | Table of Contents | Colophon
$ ps -ax
PID TT STAT TIME COMMAND
1 ?? S<s 0:00.31 /sbin/launchd
31 ?? Ss 0:00.56 /usr/sbin/syslogd -m 0 -c 5
37 ?? Ss 0:02.30 kextd
41 ?? Ss 0:03.48 /usr/sbin/configd
42 ?? Ss 0:00.47 /usr/sbin/coreaudiod
43 ?? Ss 0:00.76 /usr/sbin/diskarbitrationd
...
375 p2 Ss 0:00.03 login -p -f taylor
376 p2 S+ 0:00.04 -bash
437 p3 Ss 0:00.05 -bash
455 p3 R+ 0:00.01 ps -ax
www.gimp.org) and the NeoOffice/J suite (www.neooffice.org) are designed to work within either X11 or directly in Mac OS X's Aqua GUI environment.www.fetchworks.com). But why spend $25 on an application when you can use Mac OS X Tiger's built-in ftp command-line utility for free!MacDave:~ taylor$ ftp ftp.oreilly.com Connected to tornado.east.ora.com. 220 ProFTPD 1.2.10 Server (ftp.oreilly.com) [172.31.173.9] Name (ftp.oreilly.com:taylor): anonymous 331 Anonymous login ok, send your complete email address as your password. Password: [Type in your email address here] ftp> cd /pub/graphics/book-covers/low-res ftp> get 0596009151.gif local: 0596009151.gif remote: 0596009151.gif 229 Entering Extended Passive Mode (|||38666|) 150 Opening BINARY mode data connection for 0596009151.gif (217245 bytes) 100% |*************************************| 212 KB 45.72 KB/s 00:00 ETA 226 Transfer complete. 217245 bytes received in 00:04 (44.22 KB/s) ftp> bye 221 Goodbye.
MacDave:~ taylor$ open 0596009151.gif
MacDave:~ taylor$
$ cd
$ pwd
/Users/taylor
$ ls
Desktop Mail Pictures myopen
Documents Movies Public
Library Music Sites
$ cd Library
command option(s) filename(s)
echo '^[]2;My-Window-Title^G'
^[ characters in bash, use the key sequence Control-V Escape (press Control-V and release, then press the Escape key). To type ^G, use Control-V Control-G. The vi editor supports the same key sequence.^[ is the ASCII ESC character (which begins the sequence), and ^G is the ASCII BEL character. (The BEL character is used to ring the Terminal bell, but in this context, it terminates the escape sequence.)? character):osascript -e \ 'tell app "Terminal" to set option of first window to value'
$ osascript -e \ > 'tell app "Terminal" to set miniaturized of first window to true' $
$ cat /etc/profile # System-wide .profile for sh(1) PATH="/bin:/sbin:/usr/bin:/usr/sbin" export PATH if [ "${BASH-no}" != "no" ]; then [ -r /etc/bashrc ] && . /etc/bashrc fi $ cat /etc/bashrc # System-wide .bashrc file for interactive bash(1) shells. if [ -n "$PS1" ]; then PS1='\h:\w \u\$ '; fi # Make bash check it's window size after a process completes shopt -s checkwinsize $
PATH for all users, perhaps to add /usr/local/bin (see Chapter 4 for details on what you can find in that directory), modify the /etc/profile contents as follows:PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
$ echo $HOME
/Users/taylor
$
ls options directory-and-filenames
$ ls
$
$ ls
Desktop Library Movies Pictures Sites
Documents Mail Music Public mac-rocks
$
$ ls -a
. .bash_history Desktop Pictures
.. .dvdcss Documents Public
.CFUserTextEncoding .profile Library Sites
.DS_Store .ssh Mail mac-rocks
.Trash .sversionrc Movies
.Xauthority .viminfo Music
$
r), a user can run ls to see what's in the directory and use wildcards to match files in it.w) allows users to add, rename, and delete files in the directory.x) on that directory. To access a directory, a user must also have execute permission to all its parent directories—all the way up to the root.
$ ls -l logfile.out -rw-r--r-- 1 root wheel 1784064 Nov 6 11:25 logfile.out $ rm logfile.out override rw-r--r-- root/wheel for logfile.out? y rm: logfile.out: Permission denied $ sudo rm logfile.out Password: $ ls -l logfile.out ls: logfile.out: No such file or directory
$ ls /Volumes 110GB Extra 30 Panther X $ ls -l /Volumes total 8 drwxrwxrwx 29 taylor staff 986 12 Jun 16:37 110GB drwxrwxrwx 11 taylor unknown 374 4 Jun 23:28 Extra 30 lrwxr-xr-x 1 root admin 1 13 Jun 12:30 Tiger -> / drwxrwxr-t 61 root admin 2074 12 Jun 16:51 X
l rather than a d. This means it's a link (see "Working with Links" in Chapter 4), which is confirmed by the fact that it's shown as Tiger in the regular ls output, while the value of the alias is shown in the long listing (you can see that Panther actually points to /).
$ ls -l /Volumes
total 12
drwxrwxrwx 29 taylor staff 986 22 Sep 16:37 110GB
dr-xr-xr-x 4 unknown nogroup 136 17 Aug 2001 CITIZEN_KANE
drwxrwxrwx 11 taylor unknown 374 4 Sep 23:28 Extra 30
lrwxr-xr-x 1 root admin 1 23 Sep 12:30 Tiger -> /
drwxrwxr-t 61 root admin 2074 22 Sep 16:51 X
$ ls -l /Volumes
total 44
drwxrwxrwx 29 taylor staff 986 22 Sep 16:37 110GB
dr-xr-xr-x 4 unknown nogroup 136 17 Aug 2001 CITIZEN_KANE
drwxrwxrwx 11 taylor unknown 374 4 Sep 23:28 Extra 30
drwxrwxrwx 1 taylor admin 16384 19 Aug 20:54 NIKON D100
lrwxr-xr-x 1 root admin 1 23 Sep 12:30 Tiger -> /
drwxrwxr-t 61 root admin 2074 22 Sep 16:51 X
drwxr-xr-x 15 taylor unknown 510 27 Apr 09:37 Zephyr
|
Notation
|
Definition
|
|---|---|
*
|
An asterisk stands for any number of characters in a filename. For example, ae* matches any filename that begins with "ae" (such as aegis, aerie, aeon, etc.) if those files are in the same directory. You can use this to save typing for a single filename (for example, al* for alphabet.txt) or to choose many files at once (as in ae*). A * by itself matches all file and subdirectory names in a directory, with the exception of any starting with a period. To match all your dot files, try .??*.
|
?
|
A question mark stands for any single character (so h?p matches hop and hip, but not hp or help).
|
[]
|
Square brackets can surround a choice of single characters (i.e., one digit or one letter) you'd like to match. For example, [Cc]hapter would match either Chapter or chapter, but chap[12] would match chap1 or chap2. Use a hyphen (-) to separate a range of consecutive characters. For example, chap[1-3] matches |