Name
tar
Synopsis
tar [options] [tarfile] [other_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.
Function options
You must use exactly one of these, and it must come before any other options:
-
-c Create a new archive.
-
-r,u Append
other_filesto the end of an existing archive.-
-t Print the names of
other_filesif they are stored on the archive (ifother_filesaren’t specified, print names of all files).-
x Extract
other_filesfrom an archive (ifother_filesaren’t specified, extract all files).
Options
-
-b Set block size to 512 bytes.
-
-e If there is an error, stop.
-
-farch Store files in or extract files from archive
arch. The default is/dev/rst0. Because Mac OS X has no native tape drive support,tarproduces an error unless the-foption 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
tarcan’t decode.-
-p Keep ownership of extracted files the same as that of original permissions.
-
-sregex Using
ed-style regular expressions, change filenames in the archive.-
-v Verbose; print filenames as ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access