O'Reilly logo

Mac OS X Tiger in a Nutshell by Jason McIntosh, Chuck Toporek, Chris Stone, Andy Lester

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

tar

Synopsis

tar [options] [tarfile] [files]

Copies files to or restores files from an archive medium. If any files are directories, tar acts on the entire subtree. Options need not be preceded by a dash (-), although they may be. Note that until native drivers for tape drives exist for Mac OS X, tar can't write to tape. Note also that tar doesn't preserve resource forks or metadata when copying files that contain them.

For a complete list of tar's options, please see the manpage.

Command options

You must use exactly one of these, and it must come before any other options:

c

Create a new archive.

r, u

Append files to the end of an existing archive.

t

Print the names of files if they are stored on the archive (if files aren't specified, print names of all files).

x

Extract files from an archive (if files aren't specified, extract all files).

Selected options

-b

Set block size to 512 bytes.

-e

If there is an error, stop.

-f arch

Store files in or extract files from archive arch. The default is /dev/rst0. Because Mac OS X has no native tape drive support, tar produces an error unless the -f option is used.

-h

Dereference symbolic links.

-m

Don't restore file modification times; update them to the time of extraction.

-O

Create non-POSIX archives .

-o

Don't create archives with directory information that v7 tar can't decode.

-p

Keep ownership of extracted files the same as that of original permissions.

-s regex

Using ed-style regular expressions, change filenames in the archive.

-v

Verbose; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required