apply [options] command argument ... Apply command to one or more of the following arguments in turn. command may contain a % followed by a digit from 1 to 9. Such text is replaced with the corresponding following unused argument. Options
-N Use arguments in groups of N. For example, -2 uses two arguments for each invocation of command. Occurrences of %N in command override this option.
-a char Use char instead of % as the special character to represent arguments.
-d Display the commands that would be executed, but don't actually execute them. Example Run awk against multiple test programs and data. The example uses brace expansion as in Bash and tcsh: apply -2 'awk -f' test1.{awk,in} test2.{awk,in} test3.{awk,in}
chflags [-R [-H | -L | -P]] flags file ... Change the file flags associated with files. The flags are additional control bits that can be displayed by using ls -lo. Options
-H With -R, follow symbolic links on the command line. Symbolic links found during file traversal normally are not followed.
-L With -R, follow all symbolic links.
-P With -R, don't follow any symbolic links. This is the default.
-R Recursive. For each file that is a directory, change the flags in the entire contained directory hierarchy. Otherwise, just changes the flags for each named file. Flags
arch, archived The archived flag (privileged user only)
nodump The nodump flag (owner or privileged user only)
opaque The opaque flag (owner or privileged user only)
sappnd, sappend The system append-only flag (privileged user only)
schg, schange, simmutable The system immutable flag (privileged user only)
sunlnk, sunlink The system undeletable flag (privileged user only)
uappnd, uappend The user append-only flag (owner or privileged user only)
uchg, uchange, uimmutable The user immutable flag (owner or privileged user only)
uunlnk, uunlink The user undeletable flag (owner or privileged user only) Put the letters no in front of a flag name to clear the given flag. Symbolic links don't have flags, thus the operation always succeeds but makes no change.
chfn [options] [user] Identical to chpass. See chpass for more information.
chpass [options] [user] Change information in the user database. If supplied, the information for user is changed; otherwise, the current user's information is updated. Only a privileged user may change information for a different user, and several options are restricted to privileged users. chpass places the information into a temporary file and invokes an editor. Once the new values are filled in and the information is verified, the program updates the system's user database, /etc/master.passwd. | On Mac OS X, you are probably better off using the graphical system administration tools for user management. |
|
Options
-a list Use the literal user database entry list directly. It is a colon-separated list of items as found in each line of /etc/master.passwd. Privileged users only.
-e time Set the account's expire time to time. Privileged users only.
-p pass Use pass as the encrypted password. See getpwent(3) for the implications of this option. Privileged users only.
-s shell Use shell as the user's shell. Valid shells are listed in /etc/shells.
chsh [options] [user] Identical to chpass. See chpass for more information.
defaults [options] command [arguments] Access or update the application defaults database. Most Mac OS X applications maintain a set of application defaults in a per-user database. The database provides storage for these defaults for when the application is not running. The defaults command provides access to this database from the Unix shell. Besides the per-user database, there is also a system-wide, global database of default values. Applications are specified either by name with the -app option, or via a Java-style domain name, such as com.apple.TextEdit. Defaults are stored as key/value pairs. Keys are always strings, but values may be complicated structures such as arrays and dictionaries, or strings or binary data. They are stored as XML property lists. | It is inadvisable to change the defaults for an application that is running. The application will not see the change, and could potentially overwrite the new values when it exits. |
|
Options
-app appname Access the defaults for application appname.
-array The value for a preference key is an array. The array values are given as separate arguments in a list. The new value overwrites any previous value for the key.
-array-add Like -array, but the new elements are appended to an existing array of values.
-bool[ean] The value for a preference key is a boolean. The value must be one of trUE, FALSE, YES, or NO.
-currentHost Preference operations may be performed only on the current host.
-data The value for a preference key consists of raw data bytes. The data must be provided in hexadecimal.
-date The value for a preference key is a date.
-dict The value for a preference key is a dictionary. Dictionaries consist of key/value pairs. They are provided as separate arguments in key-pair, key-pair order. Any existing value for the key is replaced with the dictionary.
-dict-add Like -dict, but the key/value pairs are appended to an existing dictionary.
-float The value for a preference key is a floating point number.
-g, -globalDomain, NSGlobalDomain Access the global system defaults in the Global Domain. Note that NSGlobalDomain is a domain name, not really an option.
-host hostname Preference operations may be performed only on the host named hostname.
-int[eger] The value for a preference key is an integer.
-string The value for a preference key is a string. Commands
delete domain [ key] With a key, remove the given key from domain's defaults. Without key, remove all the information for domain.
domains Print the names of all domains in the user's default system.
find string Look for string in the user's domain names, keys, and values, and print a list of found matches.
help Print a help message showing command formats.
read [ domain [ key]] With no domain or key, read all of the current user's defaults, for every domain. With just a domain, read all of the current user's defaults for that domain. With both a domain and a key, read the current user's default for the given key in the given domain. In all cases, the retrieved data are printed to standard output.
read-type domain key Print the property list type for the key key in the domain domain.
write domain key value Store value as the value for the key key in the application domain domain. Quote value if it contains whitespace or shell metacharacters.
write domain proplist Store the property list proplist as the defaults for the application domain domain. The proplist must be a property list representation of a dictionary, and must be quoted so that it is a single argument.
/Developer/Tools/* The /Developer/Tools directory contains a number of programs primarily for use by developers. The following three programs are useful for general users as well; see their manpages for more information: CpMac | Copy files, keeping multiple resource forks and HFS attributes intact | MvMac | Move or rename files while preserving resource forks and HFS metadata | SplitForks | Copy the resource fork and HFS attributes from file into ._file. |
The rest of the programs are: agvtool | firewire | pbprojectdump | SetFile | BuildStrings | GetFileInfo | PPCExplain | uninstall-dev | cvs-unwrap | MergePef | ResMerger | UnRezWack | cvs-wrap | packagemaker | Rez | WSMakeStubs | DeRez | pbhelpindexer | RezWack | |
ditto [options] files directory ditto [options] directory1 directory2 Copies files and directories while preserving most file information, including resource fork and HFS metadata information when desired. ditto preserves the permissions, ownership, and timestamp of the source files in the copies. ditto overwrites identically named files in the target directory without prompting for confirmation. ditto works like cp in the first synopsis form. However, the second form differs in that cp -r copies the entire directory1 into an existing directory2, while ditto copies the contents of directory1 into directory2, creating directory2 if it doesn't already exist. Options
-arch arch When copying fat binary files, copy only the code for CPU type arch. Fat binary files contain different code for different CPU architectures. The -arch flag allows you to "thin" the binary by copying only the code for the specified architecture. Possible values for arch include ppc, m68k, i386, hppa, and sparc.
-bom pathname When copying a directory, include in the copy only those items listed in BOM (Bill of Materials) file pathname. See mkbom(8), lsbom(8), and bom(5) for more information on BOM files.
-c Create a cpio archive at directory2.
--extattr Preserve POSIX extended attributes. This is the default.
-h, --help Print a usage message.
-k Specify that archives are PKZip format.
--keepParent Embed directory1's parent directory in directory2.
--nocache Do not use the Mac OS X Unified Buffer Cache when copying files.
--noextattr Do not preserve POSIX extended attributes. Use with --rsrc to copy only resource forks and HFS metadata, without copying other extended attributes.
--norsrc When copying files, do not preserve any resource forks or HFS metadata information.
--rsrc When copying files, do include any resource fork and HFS metadata information.
--sequesterRsrc For PKZip archives, preserve resource forks and HFS metadata in the subdirectory _ _MACOSX. The resources will be found automatically when doing a PKZip extraction.
-v Be verbose; report each directory copied.
-V Be very verbose; report each file, symbolic link and device copied.
-x Treat directory1 as a source archive and extract it. The assumed format is cpio, unless -k is used. Compressed cpio format is automatically recognized and handled.
-X Don't descend into directories on another device.
-z Create or read compressed cpio archives. Example Duplicate an entire home directory, copying the contents of /Users/arnold into the directory /Volumes/Bigdisk/Users/arnold and preserving resource forks and HFS metadata: ditto --rsrc /Users/arnold "/Volumes/Big Disk/Users/arnold"
lam [options] file ... Laminate files. Lines are read from the given files and pasted together side by side. In other words, line 1 of the output is the concatenation of line 1 from each input file, line 2 is the concatenation of line 2 from each input file, and so on. Use - to mean standard input. Options
-f min. max Use min as the minimum field width for the following file's lines, and max as the maximum field width. min may start with a zero, in which case padding is done with zeros. It may also start with a -, in which case the output is left-adjusted.
-F min. max Like -f, but apply the field width specification to all following input files, until another -f is encountered.
-p min. max Like -f, but pad this file's field in the output if end-of-file is encountered on it while the other files still have data.
-P min. max Like -p, but apply the field width specification to all following input files, until another -p is encountered.
-s sep Print sep after the following file's line, before the line from the next file. Normally, the lines are joined without any intervening separator.
-S sep Like -S, but apply the separator specification to all following input files, until another -s is encountered.
-t char Input lines are terminated by the character char, instead of newline.
-T char Like -t, but apply the input line terminator specification to all following input files, until another -t is encountered.
leave [[+]hhmm] Remind you when you have to leave. The time given, hhmm, may be in 12 or 24-hour format. hh represents hours and mm represents minutes. The time is converted to the corresponding wall clock time in the upcoming 12 hours. leave prompts you to leave five minutes before, one minute before, and at the given time, and then every minute thereafter. With a leading +, the time is taken as an offset from the current time. With no argument, leave prompts you for a time; this is useful from a shell start-up file, such as ~/.profile or ~/.login. Logout, or kill it with kill in order to terminate it.
mount [options] [[device] directory] System administration command. Mount a filesystem. The filesystem on device is mounted on directory. If no device is specified, mount looks for an entry in /etc/fstab to find what device is associated with the given directory. The directory, which must already exist and should be empty, becomes the name of the root of the newly mounted filesystem. If mount is invoked with no arguments, it displays the name of each mounted device, the directory on which it is mounted, its filesystem type, and any mount options associated with the device. See also umount. Note: despite the references in the Mac OS X mount(8) manpage to /etc/fstab, that file is not used. On Mac OS X 10.4, the file /etc/fstab.hd (note the slightly different name) has these contents: $ cat /etc/fstab.hd IGNORE THIS FILE. This file does nothing, contains no useful data, and might go away in future releases. Do not depend on this file or its contents. Options
-a Mount all filesystems that are available for mounting. Use -t to limit this to all filesystems of a particular type. Filesystems marked noauto are not mounted.
-d Debugging; does everything but actually make the system call. Useful with -v.
-f Force removal of write status; used for changing a mount from read-write to read-only.
-o option Qualify the mount with a mount option. Filesystem specific options may be passed as a comma separated list in the argument to -o, and different filesystems may have additional options. The following general options are available:
auto, noauto Filesystems marked auto are mounted automatically with the -a option. Those marked noauto are not.
async, noasync The async option uses asynchronous I/O to the device. This can improve throughput at a potential cost in reliability. noasync disables this.
dev, nodev The dev option allows the system to interpret any special devices that exist on the filesystem as device files. The nodev option disallows it; device files are ignored.
exec, noexec The exec option allows the system to execute binary files on the filesystem. The noexec option disallows it.
force Identical to -f, removes write access from a mount.
nosuid Do not acknowledge any setuid or setgid bits.
rdonly Same as -r; the filesystem is mounted read-only.
sync All I/O is done synchronously.
union Merge the mounted filesystem's root and the contents of the directory upon which its mounted. Lookup operations are done in the mounted filesystem first, and then in the underlying directory. New files are created in the mounted filesystem.
update Same as -u, changes the status of an already mounted filesystem.
-r Mount the filesystem read-only.
-t type Specify the filesystem type. Possible values include afp, autofs, cd9660, cddafs, devfs, fdesc, ftp, hfs, ldf, msdos, nfs, ntfs, smbfs, synthfs, udf, ufs, volfs, and webdav. The default type is ufs. Use a comma-separated list to specify more than one type to mount, and prefix a type with no to exclude that type.
-u Update (change) the status of an already mounted filesystem. E.g., from read-only to read-write.
-v Display mount information verbosely.
-w Mount filesystem read/write. This is the default.
nano [+line] [options] [file] Replacement program for the non-free Pico editor supplied with the Pine email reader. Mac OS X provides pico as a symbolic link to nano. URL: http://www.nano-editor.org/. Options The options -a, -b, -e, -f, -g, and -j are accepted but ignored for compatibility with pico.
+ line Go to line number line at startup.
-B, --backup Upon saving a file, keep the previous version in a file with the same name and a ~ character at the end.
-c, --const Always (constantly) show the cursor position.
-D, --dos Write files in MS-DOS format (CR-LF line terminators).
-F, --multibuffer Use multiple file buffers.
-h, --help Print a command-line option summary.
-H, --historylog If support for startup files is configured, log search and replace stings in ~/.nano_history.
-i, --autoindent Enable auto-indentation. Useful for source code.
-I, --ignorercfiles If support for startup files is configured, do not read the $SYSCONFDIR/nanorc or ~/.nanorc files.
-k, --cut Enable cut from cursor to end of line with ^K.
-K, --keypad Use the ncurses keypad( ) function only if necessary. Try this option if the arrow keys on the numeric keypad do not work for you.
-l, --nofollow If editing a symbolic link, replace the link with a regular file, instead of following the link.
-m, --mouse Enable mouse support.
-M --mac Write files in Macintosh (presumably Mac OS 9) format (CR line terminators).
-N --noconvert Disable the automatic conversion of files from MS-DOS or Macintosh formats.
-o dir, --operatingdir=dir Use dir as the operating directory. The manual page says "Makes nano set up something similar to a chroot."
-p, --preserve Allow the terminal to use XON and XOFF (^Q and ^S).
-Q str, --quote=str Use str as the quoting string for justifying. If regular expression support is available, the default is "^([ \t]*[|>:}#])+"; otherwise, it's "> ".
-r cols, --fill=cols Upon reaching column cols, wrap the line.
-R, --regexp If regular expression support is available, enable regular expression matching for all search strings, and the use of \n in replacement strings. (See Chapter 7.)
-s prog, --speller=prog Use prog to check spelling.
-S, --smooth Enable smooth, line-by-line scrolling.
-t, --tempfile Always save the changed buffer without prompting for confirmation.
-T num, --tabsize=num Set the width of a tab to num characters.
-v, --view View the file. (Read-only mode.)
-V, --version Show the version number and author.
-w, --nowrap Don't wrap long lines.
-x, --nohelp Disable the help screen at the bottom of the editor.
-Y name, --syntax=name Use name as the kind of syntax highlighting to use.
-z, --suspend Enable suspension of the editor.
open-x11 program ... Run program so that it can connect to the current X server. Needed for X11 applications under Mac OS X , since Aqua is not an X server.
pbcopy [-help] [-pboard pasteboard] Copy standard input into one of the system pasteboards. The general pasteboard is used by default. The data are stored as ASCII, unless they begin with an EPS (encapsulated PostScript) or RTF (Rich Text Format) header, in which case those formats are used. See also pbpaste. Options
-help Print a help message.
-pboard pasteboard Use the pasteboard pasteboard. Possible values are general, ruler, find, or font.
pbpaste [-help] [-pboard pasteboard] [-Prefer type] Retrieve the data from the given pasteboard and print them to standard output. The general pasteboard is used by default. See also pbcopy. Options
-help Print a help message.
-pboard pasteboard Use the pasteboard pasteboard. Possible values are general, ruler, find, or font.
-Prefer type Try to retrieve data of the given type first. Possible values are ascii, rtf, or ps. If data of the given type are not found, pbpaste retrieves whatever data are there.
pico [+line] [options] [file] Small simple editor. This is actually the "Nano" Free Software editor. See nano for more information.
ps [options] Report on active processes. Following the BSD tradition, a minus sign is allowed but not required in front of options. In options, list arguments should either be separated by commas or put in double quotes. Options
-a List other users' processes, as well as your own.
-A List other users' processes, including those without a controlling terminal.
-c In the command column, print just the command name, instead of the full command line.
-C Use a different algorithm for calculating CPU percentage which ignores resident time.
-e Include environment information after the command.
-h Print a header on each page of output.
-j Jobs format. Print the information for the command, jobc, pgid, pid, ppid, sess, state, time tt, and user keywords.
-l Produce a long listing. Print the information for the command, cpu, nice, pid, ppid, pri, rss, state, time tt, uid, vsz, and wchan keywords.
-L Print list of keywords (field specifiers) that can be used for output formatting or for sorting.
-m Sort by memory usage, not by process ID.
-M Show threads.
-N, --deselect Negate the selection.
-o list Like -O, but use only the keywords in list.
-O list Append the keywords in list after the PID. The title of each keyword may be changed by using an = sign after the keyword (keyword=newtitle).
-p nums Include only specified processes, which are given in a space-delimited list.
-r Sort by CPU usage instead of by process ID number.
-S Include dead child process data in parent's total.
-tttys Display processes running on the specified terminals.
-T List information about processes using the current standard input.
-u Give information for the keywords command, %cpu, %mem, pid, rss, start, state, time tt, user, and vsz. This option implies -r.
-U user Display processes for the specified user.
-v Display virtual memory format. This includes the keywords command, %cpu, lim, %mem, pagein, pid, re, rss, sl, state, time, tsiz, and vsz. This option implies -m.
-w Wide format. By default, use 132 columns. Repeating this option causes ps to never truncate lines.
-x Display processes without an associated controlling terminal. Keywords Aliases for keywords are listed second, next to the keyword. %cpu, pcpu | Percentage of CPU used. | %mem, pmem | Percentage of memory used. | acflag, acflg | Accounting flag. | command | Command and arguments. | cpu | Short-term factor of CPU used. | flags, f | Hexadecimal representation of process flags. | inblk, inblock | Total amount of blocks read. | jobc | Count for job control. | ktrace | Tracing flags. | kTRacep | Tracing vnode. | lim | Limit of memory usage. | logname | Username of the user that started the command. | lstart | Start time. | majflt | Page fault totals. | minflt | Page reclaim totals. | msgrcv | Messages received total. | msgsnd | Messages sent total. | nice, ni | Nice value. | nivcsw | Involuntary context switches total. | nsigs, nsignals | Signals taken total. | nswap | Swaps in/out total. | nvcsw | Voluntary context switches total. | nwchan | Wait channel (as number). | oublk, oublock | Blocks written total. | p_ru | Resource usage (valid only for zombie). | paddr | Swap address. | pagein | Pageins (same as majflt). | pgid | Process group number. | pid | Process ID number. | poip | Number of pageouts in progress. | ppid | Parent process ID. | pri | Scheduling priority. | re | Core residency time. | rgid | Real GID. | rlink | Reverse link on run queue. | rss | Resident set size. | rsz, rssize | Resident set size + (text size/text use count). | rtprio | Realtime priority (101 = not a realtime process). | ruid | Real UID. | ruser | Username (from ruid). | sess | Session pointer. | sig, pending | Signals that are pending. | sigcatch, caught | Signals that have been caught. | sigignore, ignored | Signals that are ignored. | sigmask, blocked | Signals that are blocked. | sl | Sleep time. | start | Start time. | state, stat | Symbolic process state. | svgid | Saved GID from a setgid executable. | svuid | Saved UID from a setuid executable. | tdev | Device number of the controlling terminal. | time, cputime | Total of user and system CPU time. | tpgid | Process group ID of the controlling terminal. | tsess | Session pointer for the controlling terminal. | tsiz | Text size (in kilobytes). | tt | Name of controlling terminal. | tty | Controlling terminal's full name. | uprocp | Process pointer. | ucomm | Command name used for accounting. | uid | Effective UID. | upr, usrpri | Scheduling priority after a system call has been made. | user | Username (from uid). | vsz, vsize | Virtual size (in kilobytes). | wchan | Wait channel (as symbolic name). | xstat | Exit or stop status (only for stopped or zombie processes). |
pstopdf [inputfile] [-o outfile] [options] Convert a PostScript input file to a PDF file. The PDF file is always written to a file, whose name is either derived from the input filename, or which must be supplied via -o if the input data is read from standard input. Options
-i Read PostScript from standard input instead of from inputfile.
-l Write messages to a log file instead of to standard output. The log file name is the same as the output filename, with a .log extension added to it.
-p Print a progress message at the end of each page. The messages always go to standard output, even with -l.
-o file Place the output in file. By default, for an input PostScript file whizprogdoc.ps, the PDF file will be named whizprogdoc.pdf.
pythonw python-args ... Run a python program that has a GUI (Graphical User Interface). URL: http://www.python.org.
say [options] string | -f file Text to speech synthesizer. The text is converted to sound and played through the system's speakers, or saved to a file. Options
-f file Read the text in file.
-o file.aiff Save the sound in the given output file.
-v voice Use the given voice for producing speech. Both masculine and feminine voices are available. The default voice is selected in the System Preferences. Example Add voice prompts to your shell scripts with the following shell function: prompt ( ) { say "$*" & Play prompt in background echo -n "$*"": " Traditional shell prompting }
shar file ... Produce a Shell archive. The output is a shell script, which when run with a Bourne-compatible shell, will extract the original files and directories. It is useful for distributing files via electronic mail or ftp. All directories should be named on the command line before regular files so that they will be re-created correctly. | This version of shar is very simple. It cannot handle binary data files, and may not be robust in the face of unusual filenames either. |
|
shlock -f lockfile [-p PID] [-u] [-v] Create or verify a lockfile that can be used from shell scripts . shlock uses the rename(2) system call for making the final lock file; its operation is atomic. When creating a lock, use -p to place the process ID into the file, so that a later invocation can verify the existence of the original creating process. When verifying a lock, do not use the -p option. shlock then uses the kill command to verify that the process recorded in the file is still alive. If not, shlock exits with a value of 1. Options
-f lockfile Use lockfile as the name of the file to create or check. This option must be provided.
-p PID Write PID into lockfile.
-u UUCP-compatible locking. shlock writes the pid number as a binary value.
-v Be verbose. Example Create and use a lock file: lockf=/tmp/whizprog.lock if shlock -f $lockf -p $$ then do whatever is needed with the file locked rm -f $lockf else echo "$0: Process ID $(cat $lockf) holds the lock" 1>&2 exit 1 fi
srm [options] file ... Securely remove files. srm overwrites the data in each file before unlinking it. This prevents recovery of file data by examination of the raw disk blocks. The options are purposely similar to those of the standard rm command. URL: http://srm.sourceforge.net. Options
-d, --directory Ignored. For compatibility with rm.
-f, --force Ignore nonexistent files. This prevents srm from prompting.
--help Display an option summary and then exit.
-i, --interactive Interactive. Prompt before removing files.
-m, --medium Use seven US DOD compliant passes (0xF6, 0x00, 0xFF, random, 0x00, 0xFF, and random).
-n, --nounlink Overwrite the file, but do not unlink or rename it.
-r, -R, --recursive Recursively remove the contents of directories.
-s, --simple Overwrite files with just a single pass of random data.
-v, --verbose Be verbose.
--version Print version information and then exit.
-z, --zero Zero the blocks used by the file after overwriting them.
umount [-fv] device | remotespec umount -a|-A [-fv] [-h host] [-t type] System administration command. Unmount a mounted filesystem. device is a device name or other string indicating what is mounted. A remotespec is a string of the form host:directory indicating a remote host and filesystem (typically mounted via NFS). See also mount. Options
-a Unmount all filesystems listed in /etc/fstab or Open Directory. (See mount for information about Mac OS X and /etc/fstab.)
-A Unmount all currently mounted filesystems, except for the root filesystem (mounted at /).
-f Force the unmount. Open device files continue to work. Other file accesses fail.
-h host Unmount all filesystems from the server host.
-t type Unmount filesystems of only the specified type.
-v Be verbose. |