Cover image for Mac OS X Tiger in a Nutshell

Book description

Following the common-sense O'Reilly style, Mac OS X Tiger in a Nutshell cuts through the chaff and gives you practical details you can use every day. Everything you need to know about the Unix side of Mac OS X has been systematically documented in this book.

Mac OS X Tiger in a Nutshell offers a complete overview of Mac OS X Tiger (Version 10.4), focusing on the BSD Unix layer. This book familiarizes you with over 300 of Tiger's Unix commands, the Terminal application, file management, system and network administration issues, and more.

Completely revised for Mac OS X Tiger, this book offers:

  • The most complete and thorough coverage of Mac OS X's Unix commands you'll find anywhere (even in the system)

  • An overview of basic system and network administration features, including coverage of NetInfo and Directory Services

  • An introduction to using Mac OS X's Unix command-line interface, the Terminal application

  • An overview of Mac OS X's Unix text editors, including vi and Emacs

  • Information on shell syntax variables for Tiger's default Unix shell, bash

Each command and option in this book's Unix Command Reference has been painstakingly tested and checked against Tiger; even the manpages that ship with Mac OS X can't compete in accuracy. Mac OS X Tiger in a Nutshell is the most comprehensive quick reference on the market and is a must for any serious Mac user.

Table of Contents

  1. MAC OS X Tiger in a Nutshell
    1. SPECIAL OFFER: Upgrade this ebook with O’Reilly
    2. Preface
      1. Audience for This Book
      2. How This Book Is Organized
      3. Conventions Used in This Book
      4. Comments and Questions
      5. Acknowledgments
        1. Acknowledgments for Andy Lester
      6. Safari® Enabled
    3. I. Commands and Shells
      1. 1. Introduction
        1. 1.1. What You'll Find
        2. 1.2. Beginner's Guide
          1. 1.2.1. Communication
          2. 1.2.2. Comparisons
          3. 1.2.3. File Management
          4. 1.2.4. Printing
          5. 1.2.5. Programming
          6. 1.2.6. Searching
          7. 1.2.7. Shell Programming
          8. 1.2.8. Storage
          9. 1.2.9. System Status
          10. 1.2.10. Text Processing
          11. 1.2.11. Miscellaneous
      2. 2. Unix Command Reference
        1. 2.1. Alphabetical Summary of Commands
          1. ac
          2. appleping
          3. appletalk
          4. appletviewer
          5. apply
          6. apropos
          7. asr
          8. at
          9. at_cho_prn
          10. atlookup
          11. atprint
          12. atq
          13. atrm
          14. atstatus
          15. automount
          16. banner
          17. basename
          18. batch
          19. bc
          20. biff
          21. bless
          22. cal
          23. calendar
          24. cancel
          25. cat
          26. CCLEngine
          27. certtool
          28. chflags
          29. chgrp
          30. chkpasswd
          31. chmod
          32. chown
          33. cksum
          34. clear
          35. cmp
          36. colcrt
          37. colrm
          38. column
          39. comm
          40. compress
          41. configd
          42. cp
          43. cpio
          44. CpMac
          45. create_nidb
          46. crontab
          47. curl
          48. cut
          49. date
          50. dc
          51. dd
          52. defaults
          53. df
          54. diff
          55. diff3
          56. dig
          57. DirectoryService
          58. dirname
          59. diskarbitrationd
          60. diskutil
          61. ditto
          62. dmesg
          63. dns-sd
          64. drutil
          65. dscl
          66. du
          67. dynamic_pager
          68. echo
          69. egrep
          70. enscript
          71. env
          72. expand
          73. expr
          74. false
          75. fdisk
          76. fetchmail
          77. fgrep
          78. file
          79. find
          80. FixupResourceForks
          81. fmt
          82. fold
          83. fs_usage
          84. fsaclctl
          85. fsck
          86. fsck_hfs
          87. fsck_msdos
          88. ftp
          89. gcc_select
          90. GetFileInfo
          91. gnutar
          92. grep
          93. gunzip
          94. gzcat
          95. gzip
          96. halt
          97. hdid
          98. hdiutil
          99. head
          100. host
          101. hostinfo
          102. hostname
          103. hwprefs
          104. id
          105. ifconfig
          106. info
          107. install
          108. installer
          109. ipconfig
          110. join
          111. jot
          112. kdump
          113. kdumpd
          114. kill
          115. killall
          116. ktrace
          117. languagesetup
          118. last
          119. launchctl
          120. launchd
          121. leave
          122. less
          123. ln
          124. locate
          125. lock
          126. lockfile
          127. logger
          128. look
          129. lp
          130. lpc
          131. lpq
          132. lpr
          133. lprm
          134. lpstat
          135. ls
          136. lsbom
          137. lsof
          138. machine
          139. mailq
          140. mailstat
          141. makekey
          142. man
          143. md5
          144. mDNS
          145. mDNSResponder
          146. mdcheckschema
          147. mdfind
          148. mdimport
          149. mdls
          150. mdutil
          151. merge
          152. mkbom
          153. mkdir
          154. more
          155. mount
          156. mount_afp
          157. mount_autofs
          158. mount_cd9660
          159. mount_cddafs
          160. mount_devfs
          161. mount_fdesc
          162. mount_ftp
          163. mount_hfs
          164. mount_msdos
          165. mount_nfs
          166. mount_ntfs
          167. mount_smbfs
          168. mount_synthfs
          169. mount_udf
          170. mount_volfs
          171. mount_webdav
          172. mv
          173. MvMac
          174. netstat
          175. nice
          176. nicl
          177. nidomain
          178. nidump
          179. nifind
          180. nigrep
          181. niload
          182. nireport
          183. niutil
          184. notifyd
          185. nslookup
          186. ntp-wait
          187. ntptimeset
          188. nvram
          189. od
          190. open
          191. opendiff
          192. open-x11
          193. osacompile
          194. osalang
          195. osascript
          196. passwd
          197. paste
          198. pax
          199. pbcopy
          200. pbpaste
          201. pdisk
          202. periodic
          203. ping
          204. pl
          205. plutil
          206. pmset
          207. pr
          208. printenv
          209. ps
          210. pwd
          211. quota
          212. rcp
          213. reboot
          214. register_mach_bootstrap_servers
          215. renice
          216. rev
          217. rlogin
          218. rm
          219. rmdir
          220. rsync
          221. say
          222. scp
          223. screencapture
          224. script
          225. scselect
          226. scutil
          227. sdiff
          228. sed
          229. service
          230. SetFile
          231. sftp
          232. showmount
          233. shutdown
          234. sips
          235. slogin
          236. slp_reg
          237. softwareupdate
          238. sort
          239. split
          240. SplitForks
          241. spray
          242. srm
          243. ssh
          244. strings
          245. stty
          246. su
          247. sudo
          248. sw_vers
          249. systemkeychain
          250. system_profiler
          251. SystemStarter
          252. tab2space
          253. tail
          254. talk
          255. tar
          256. tee
          257. telnet
          258. test
          259. tftp
          260. tiff2icns
          261. tiffutil
          262. time
          263. top
          264. touch
          265. tr
          266. traceroute
          267. true
          268. tset
          269. tty
          270. umount
          271. uname
          272. uncompress
          273. unexpand
          274. uniq
          275. units
          276. unzip
          277. uptime
          278. users
          279. uudecode
          280. uuencode
          281. uuidgen
          282. vi
          283. view
          284. visudo
          285. vm_stat
          286. vmmap
          287. vndevice
          288. vsdbutil
          289. w
          290. wall
          291. wc
          292. whatis
          293. whereis
          294. which
          295. who
          296. whoami
          297. whois
          298. write
          299. xargs
          300. yes
          301. zcat
          302. zcmp
          303. zdiff
          304. zgrep
          305. zip
          306. zipinfo
          307. zmore
          308. znew
          309. zprint
      3. 3. Using the Terminal
        1. 3.1. Using the Terminal
          1. 3.1.1. Terminal Preferences
            1. 3.1.1.1. Setting a default shell
            2. 3.1.1.2. The Terminal Inspector
          2. 3.1.2. Saving and Loading Terminals
          3. 3.1.3. Connect to Server
          4. 3.1.4. Secure Keyboard Entry
          5. 3.1.5. Split-View Scrollback
        2. 3.2. Process Management
          1. 3.2.1. Seeing processes
            1. 3.2.1.1. Sending signals with kill and killall
          2. 3.2.2. Mac OS X's Console Mode
      4. 4. Shell Overview
        1. 4.1. Introduction to the Shell
        2. 4.2. Shell Flavors
        3. 4.3. Common Features
        4. 4.4. Differing Features
      5. 5. bash: The Bourne-Again Shell
        1. 5.1. Invoking the Shell
          1. 5.1.1. Options
          2. 5.1.2. Arguments
        2. 5.2. Syntax
          1. 5.2.1. Special Files
          2. 5.2.2. Filename Metacharacters
            1. 5.2.2.1. Examples
          3. 5.2.3. Command-Line Editing
          4. 5.2.4. Quoting
            1. 5.2.4.1. Examples
          5. 5.2.5. Command Forms
            1. 5.2.5.1. Examples
          6. 5.2.6. Redirection Forms
            1. 5.2.6.1. Examples
        3. 5.3. Variables
          1. 5.3.1. Variable Substitution
          2. 5.3.2. Built-in Shell Variables
        4. 5.4. Arithmetic Expressions
          1. 5.4.1. Operators
          2. 5.4.2. Examples
        5. 5.5. Command History
          1. 5.5.1. Line-Edit Mode
          2. 5.5.2. The fc Command
            1. 5.5.2.1. Examples
          3. 5.5.3. Command Substitution
          4. 5.5.4. Variables in Prompt
        6. 5.6. Job Control
        7. 5.7. Built-in Commands
          1. #
          2. #!
          3. :
          4. .
          5. alias
          6. bg
          7. bind
          8. break
          9. builtin
          10. case
          11. cd
          12. command
          13. compgen
          14. complete
          15. continue
          16. declare
          17. dirs
          18. disown
          19. echo
          20. enable
          21. eval
          22. exec
          23. exit
          24. export
          25. fc
          26. fg
          27. for
          28. function
          29. getopts
          30. hash
          31. help
          32. history
          33. if
          34. jobs
          35. kill
          36. let
          37. local
          38. logout
          39. popd
          40. printf
          41. pushd
          42. pwd
          43. read
          44. readonly
          45. return
          46. select
          47. set
          48. shift
          49. shopt
          50. source
          51. suspend
          52. test
          53. times
          54. trap
          55. type
          56. typeset
          57. ulimit
          58. umask
          59. unalias
          60. unset
          61. until
          62. wait
          63. while
    4. II. Text Editing and Processing
      1. 6. Pattern Matching
        1. 6.1. Filenames Versus Patterns
        2. 6.2. Metacharacters, Listed by Unix Program
        3. 6.3. Metacharacters
        4. 6.4. Examples of Searching
          1. 6.4.1. Examples of Searching and Replacing
      2. 7. The vi Editor
        1. 7.1. Review of vi Operations
          1. 7.1.1. Command Mode
          2. 7.1.2. Insert Mode
          3. 7.1.3. Syntax of vi Commands
            1. 7.1.3.1. Examples
          4. 7.1.4. Status-Line Commands
        2. 7.2. vi Command-Line Options
        3. 7.3. ex Command-Line Options
        4. 7.4. Movement Commands
          1. 7.4.1. Character
          2. 7.4.2. Text
          3. 7.4.3. Lines
          4. 7.4.4. Screens
          5. 7.4.5. Searches
            1. 7.4.5.1. Line numbering
            2. 7.4.5.2. Marking position
        5. 7.5. Edit Commands
          1. 7.5.1. Inserting New Text
          2. 7.5.2. Changing and Deleting Text
        6. 7.6. Saving and Exiting
        7. 7.7. Accessing Multiple Files
        8. 7.8. Window Commands
        9. 7.9. Interacting with the Shell
        10. 7.10. Macros
        11. 7.11. Miscellaneous Commands
        12. 7.12. Alphabetical List of Keys in Command Mode
        13. 7.13. Syntax of ex Commands
          1. 7.13.1. Options
          2. 7.13.2. Addresses
          3. 7.13.3. Address Symbols
        14. 7.14. Alphabetical Summary of ex Commands
          1. abbrev
          2. append
          3. args
          4. cd
          5. bdelete
          6. buffer
          7. buffers
          8. center
          9. change
          10. close
          11. copy
          12. delete
          13. edit
          14. exusage
          15. file
          16. fold
          17. foldclose
          18. foldopen
          19. global
          20. help
          21. hide
          22. insert
          23. join
          24. jumps
          25. k
          26. list
          27. left
          28. map
          29. mark
          30. marks
          31. mkexrc
          32. move
          33. new
          34. next
          35. nohlsearch
          36. number
          37. open
          38. preserve
          39. previous
          40. print
          41. put
          42. qall
          43. quit
          44. read
          45. read
          46. recover
          47. redo
          48. resize
          49. rewind
          50. right
          51. sbuffer
          52. sbnext
          53. snext
          54. split
          55. sprevious
          56. script
          57. set
          58. shell
          59. source
          60. stop
          61. substitute
          62. suspend
          63. sview
          64. t
          65. tag
          66. tags
          67. unabbreviate
          68. undo
          69. unhide
          70. unmap
          71. v
          72. version
          73. vi
          74. view
          75. visual
          76. viusage
          77. vsplit
          78. wall
          79. wnext
          80. wq
          81. wqall
          82. write
          83. write
          84. X
          85. xit
          86. yank
          87. z
          88. !
          89. =
          90. < >
          91. address
          92. Return
          93. @
          94. @@
          95. &
          96. ~
        15. 7.15. vi Configuration
          1. 7.15.1. The :set Command
          2. 7.15.2. Options Used by :set
          3. 7.15.3. Sample ~/.exrc File
      3. 8. The Emacs Editor
        1. 8.1. Emacs Concepts
          1. 8.1.1. Modes
          2. 8.1.2. Buffer and Window
          3. 8.1.3. Point and Mark
          4. 8.1.4. Kill and Yank
        2. 8.2. Typical Problems
        3. 8.3. Notes on the Tables
          1. 8.3.1. Absolutely Essential Commands
        4. 8.4. Summary of Commands by Group
          1. 8.4.1. File Handling Commands
          2. 8.4.2. Cursor Movement Commands
          3. 8.4.3. Deletion Commands
          4. 8.4.4. Paragraphs and Regions
          5. 8.4.5. Stopping and Undoing Commands
          6. 8.4.6. Transposition Commands
          7. 8.4.7. Capitalization Commands
          8. 8.4.8. Incremental Search Commands
          9. 8.4.9. Word Abbreviation Commands
          10. 8.4.10. Buffer Manipulation Commands
          11. 8.4.11. Window Commands
          12. 8.4.12. Special Shell Mode Characters
          13. 8.4.13. Indentation Commands
          14. 8.4.14. Centering Commands
          15. 8.4.15. Macro Commands
          16. 8.4.16. Detail Information Help Commands
          17. 8.4.17. Help Commands
        5. 8.5. Summary of Commands by Key
          1. 8.5.1. Control-Key Sequences
          2. 8.5.2. Meta-Key Sequences
        6. 8.6. Summary of Commands by Name
          1. 8.6.1. Extending Emacs
          2. 8.6.2. The .emacs File
          3. 8.6.3. GUI Emacs
    5. III. Managing Mac OS X
      1. 9. Filesystem Overview
        1. 9.1. Mac OS X Filesystems
          1. 9.1.1. Differences Between HFS+ and UFS
          2. 9.1.2. File Forks
            1. 9.1.2.1. Attribute forks
          3. 9.1.3. Journaling
          4. 9.1.4. Other Supported Filesystem Formats
        2. 9.2. Filesystem Organization
          1. 9.2.1. Domains
          2. 9.2.2. Special Folders
            1. 9.2.2.1. User directories
            2. 9.2.2.2. The Shared user directory
            3. 9.2.2.3. The Library folder
        3. 9.3. Hidden Files
          1. 9.3.1. Seeing Hidden Files
          2. 9.3.2. Dotfiles
          3. 9.3.3. Exploring root
            1. 9.3.3.1. Hidden Mac OS 9 files
            2. 9.3.3.2. Hidden Darwin files
        4. 9.4. The File Permissions System
          1. 9.4.1. Owners and Groups
          2. 9.4.2. Viewing and Modifying File Permissions
      2. 10. Directory Services
        1. 10.1. Understanding Directory Services
        2. 10.2. Programming with Directory Services
          1. 10.2.1. Working with Passwords
        3. 10.3. Configuring Directory Services
        4. 10.4. NetInfo Manager
        5. 10.5. Directory Services Utilities
        6. 10.6. Managing Groups
          1. 10.6.1. Creating a Group with niload
          2. 10.6.2. Creating a Group with dscl
          3. 10.6.3. Adding Users to a Group
          4. 10.6.4. Listing Groups with nidump
          5. 10.6.5. Deleting a Group
        7. 10.7. Managing Users and Passwords
          1. 10.7.1. Creating a User with niload
          2. 10.7.2. Creating a User with dscl
          3. 10.7.3. Creating a User's Home Directory
          4. 10.7.4. Granting Administrative Privileges
          5. 10.7.5. Modifying a User
          6. 10.7.6. Listing Users with nidump
          7. 10.7.7. Deleting a User
        8. 10.8. Managing Hostnames and IP Addresses
          1. 10.8.1. Creating a Host with niload
        9. 10.9. Exporting Directories with NFS
        10. 10.10. Flat Files and Their Directory Services Counterparts
        11. 10.11. Restoring the Directory Services Database
      3. 11. Running Network Services
        1. 11.1. Network Services Overview
        2. 11.2. Running Services in Mac OS X
          1. 11.2.1. Running Services Through the Sharing Pane
        3. 11.3. Mail Services
          1. 11.3.1. Mail Transport Agents (Postfix)
            1. 11.3.1.1. Using Postfix
            2. 11.3.1.2. Configuring a local mailer
            3. 11.3.1.3. Configuring a mail server
          2. 11.3.2. Mail Delivery Agents
        4. 11.4. Web Services
          1. 11.4.1. Apache Configuration
          2. 11.4.2. Apache Modules
        5. 11.5. File Transfer Protocol (FTP)
          1. 11.5.1. Enabling Anonymous FTP
        6. 11.6. Remote Login Services
          1. 11.6.1. The Secure Shell
          2. 11.6.2. Telnet
          3. 11.6.3. The Remote Shell
        7. 11.7. File Sharing Services
        8. 11.8. Daemon Management
          1. 11.8.1. Bootstrap Daemons
          2. 11.8.2. StartupItems
            1. 11.8.2.1. Manually running StartupItems
            2. 11.8.2.2. The /etc/hostconfig file
            3. 11.8.2.3. StartupParameters.plist
          3. 11.8.3. launchd
          4. 11.8.4. xinetd
      4. 12. The X Window System
        1. 12.1. Installing X11
        2. 12.2. Running X11
        3. 12.3. Customizing X11
          1. 12.3.1. Dot-files, Desktops, and Window Managers
          2. 12.3.2. X11 Preferences, Application Menu, and Dock Menu
            1. 12.3.2.1. Input
            2. 12.3.2.2. Output
            3. 12.3.2.3. Customizing X11's Applications menu
        4. 12.4. X11-based Applications and Libraries
          1. 12.4.1. Aqua-X11 Interactions
          2. 12.4.2. TKAqua
        5. 12.5. Connecting to Other X Window Systems
          1. 12.5.1. OSX2X
        6. 12.6. Virtual Network Computing
          1. 12.6.1. Launching VNC
            1. 12.6.1.1. VNC and SSH
          2. 12.6.2. Connecting to the Mac OS X VNC Server
      5. 13. The Defaults System
        1. 13.1. Property Lists
        2. 13.2. Viewing and Editing Property Lists
          1. 13.2.1. Using the Property List Editor
          2. 13.2.2. The defaults Command
            1. defaults
    6. About the Authors
    7. Colophon
    8. SPECIAL OFFER: Upgrade this ebook with O’Reilly