home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeMac OS X for Unix GeeksSearch this book

1.6. Mac OS X's Unix Development Tools

The version of Unix that you'll encounter in Mac OS X's Terminal is similar to other versions you have seen, but dissimilar in some fundamental and often surprising ways. Although most tools are in their usual place, some are not on the system, while others are not where you would typically expect to find them on other Unix systems.

The lists shown in this section contain a sampling of the Unix commands developers will find on Mac OS X. It is, by no means, a complete list of the Unix utilities found on your system. Because there are so many commands, they are organized into several categories. If you are an experienced Unix user, many of these commands will be familiar to you, but we've referenced them here so you can quickly determine whether or not a command you need is available. Unless otherwise specified, all of the tools in the following lists can be found in /usr/bin or /usr/libexec. Some tools are available with the standard distribution of Mac OS X, but others are available only after installing the Developer Tools. (See Chapter 4 for more information about the Developer Tools). Appendix B contains a listing of commands that don't have manpages on Mac OS X.

1.6.2. Apple's Command-line Developer Tools

The following list of utilities can be found in /Developer/Tools after you have installed the Developer Tools package. Project Builder depends on some of these tools. Many of these tools have their roots in Macintosh Programmer's Workshop (MPW), Apple's old development environment.

agvtool
Acts as a versioning tool for Project Builder projects.

BuildStrings
Creates resource string definitions.

CpMac
Serves as an alternative to cp; preserves resource forks when copying.

cvs-unwrap
Extracts a tar file created by cvs-wrap.

cvs-wrap
Combines a directory into a single tar file.

cvswrappers
Checks an entire directory into CVS as a binary file.

DeRez
Displays the contents of a resource fork.

GetFileInfo
Displays extended information about a file, including creator code and file type.

lnresolve
Returns the target of a symbolic link.

MergePef
Merges code fragments from one file into another.

MvMac
Serves as an alternative to mv; preserves resource forks when copying.

pbhelpindexer
Creates an index of Apple's API documentation for Project Builder.

pbprojectdump
Used by Project Builder's FileMerge feature to produce more readable diffs between file versions.

pbxcp
Supports Project Builder's build system; an internal tool.

pbxhmapdump
Debugs header maps; also internal to Project Builder.

ResMerger
Merges resource manager resource files. Project Builder's build system compiles .r files into .rsrc files using Rez, and if needed, Project Builder merges multiple files using ResMerger.

Rez
Compiles resource files.

RezWack
Embeds resource and data forks in a file.

sdp
Converts a scripting definition file into another format.

SetFile
Sets HFS+ file attributes.

SplitForks
Splits the resource fork, moving it from a dual-forked file into a file named ._pathname.

UnRezWack
Removes resource and data forks from a file.

WSMakeStubs
Generates web service stubs from a WSDL file.

Also available in the /Developer/Tools directory is a Perl script (uninstall-devtools.pl), which can be used to uninstall the Developer Tools.

1.6.7. Working with Files and Directories

You can use the following tools to compare, copy, and examine files.

cat
Concatenates and displays files.

cd
Changes directory.

chflags
Changes file flags.

chmod
Changes access modes on files.

cmp
Compares two files, byte by byte.

comm
Compares two sorted files.

cp
Copies files.

diff
Compares two files, line by line.

diff3
Compares three files.

file
Determines a file's type.

head
Shows the first few lines of a file.

less
Serves as an enhanced alternative to more.

ln
Creates symbolic or hard links.

TIP: Symbolic and hard links are not the same as Carbon aliases that you create in the Finder (File Figure Make Alias). Unix programs cannot follow Carbon aliases, but all Mac OS X applications (Carbon, Cocoa, Classic, and Unix) can follow symbolic or hard links.

ls
Lists files or directories.

mkdir
Makes a new directory.

more
Displays files one screen at a time.

mv
Moves or renames files or directories.

patch
Merges a set of changes into a file.

pwd
Prints the working directory.

rcp
Insecurely copies a file to or from a remote machine. Use scp instead.

rm
Removes files.

rmdir
Removes directories.

scp
Secures alternative to rcp.

sdiff
Compares two files, side-by-side and line-by-line.

split
Splits files evenly.

tail
Shows the last few lines of a file.

vis
Displays nonprinting characters in a readable form.

unvis
Restores the output of vis to its original form.

wc
Counts lines, words, and characters.

zcmp
Compares two compressed files, byte-by-byte.

zdiff
Compare two compressed files, line-by-line.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.