@ archive |
| (c and r mode only) The specified archive is opened and the entries in it will be appended to the current archive. As a simple example, -c -f - newfile @ original.tar writes a new archive to standard output containing a file newfile and all of the entries from original.tar. In contrast, -c -f - newfile original.tar creates a new archive with only two entries. Similarly, -czf ---format pax @ - reads an archive from standard input (whose format will be determined automatically) and converts it into a gzip-compressed pax-format archive on stdout. In this way, tar can be used to convert archives from one format to another. |
-b blocksize |
| Specify the block size, in 512-byte records, for tape drive I/O. As a rule, this argument is only needed when reading from or writing to tape drives, and usually not even then as the default block size of 20 records (10240 bytes) is very common. |
-C directory |
| In c and r mode, this changes the directory before adding the following files. In x mode, change directories after opening the archive but before extracting entries from the archive. |
--check-links -( -W check-links) |
| (c and r modes only) Issue a warning message unless all links to each file are archived. |
--exclude pattern(-W exclude = pattern) |
| Do not process files or directories that match the specified pattern. Note that exclusions take precedence over patterns or filenames specified on the command line. |
--format format(-W format = format) |
| (c mode only) Use the specified format for the created archive. Supported formats include "cpio", "pax", "shar", and "ustar". Other formats may also be supported; see libarchive-formats(5) for more information about currently-supported formats. |
-f file |
| Read the archive from or write the archive to the specified file. The filename can be - for standard input or standard output. If not specified, the default tape device will be used. (On FreeBSD, the default tape device is /dev/sa0.) |
--fast-read -( -W fast-read) |
| (x and t mode only) Extract or list only the first archive entry that matches each pattern or filename operand. Exit as soon as each specified pattern or filename has been matched. By default, the archive is always read to the very end, since there can be multiple entries with the same name and, by convention, later entries overwrite earlier entries. This option is provided as a performance optimization. |
-H | (c and r mode only) Symbolic links named on the command line will be followed; the target of the link will be archived, not the link itself. |
-h | (c and r mode only) Synonym for -L . |
-I | Synonym for -T . |
--include pattern(-W include = pattern) |
| Process only files or directories that match the specified pattern. Note that exclusions specified with --exclude take precedence over inclusions. If no inclusions are explicitly specified, all entries are processed by default. The --include option is especially useful when filtering archives. For example, the command -c -f new.tar--include=*foo* @ old.tgz creates a new archive new.tar containing only the entries from old.tgz containing the string 'foo'. |
-j | (c mode only) Compress the resulting archive with bzip2(1). In extract or list modes, this option is ignored. Note that, unlike other tar implementations, this implementation recognizes bzip2 compression automatically when reading archives. |
-k | (x mode only) Do not overwrite existing files. In particular, if a file appears more than once in an archive, later copies will not overwrite earlier copies. |
-L | (c and r mode only) All symbolic links will be followed. Normally, symbolic links are archived as such. With this option, the target of the link will be archived instead. |
-l | If POSIXLY_CORRECT is specified in the environment, this is a synonym for the --check-links option. Otherwise, an error will be displayed. Users who desire behavior compatible with GNU tar should use the --one-file-system option instead. |
-m | (x mode only) Do not extract modification time. By default, the modification time is set to the time stored in the archive. |
-n | (c, r, u modes only) Do not recursively archive the contents of directories. |
--newer date(-W newer = date) |
| (c, r, u modes only) Only include files and directories newer than the specified date. This compares ctime entries. |
--newer-mtime date(-W newer-mtime = date) |
| (c, r, u modes only) Like --newer , except it compares mtime entries instead of ctime entries. |
--newer-than file(-W newer-than = file) |
| (c, r, u modes only) Only include files and directories newer than the specified file. This compares ctime entries. |
--newer-mtime-than file(-W newer-mtime-than = file) |
| (c, r, u modes only) Like --newer-than , except it compares mtime entries instead of ctime entries. |
--nodump -( -W nodump) |
| (c and r modes only) Honor the nodump file flag by skipping this file. |
--null -( -W null) |
| (use with -I , -T , or -X ) Filenames or patterns are separated by null characters, not by newlines. This is often used to read filenames output by the -print0 option to find(1). |
-O | (x, t modes only) In extract (-x) mode, files will be written to standard out rather than being extracted to disk. In list (-t) mode, the file listing will be written to stderr rather than the usual stdout. |
-o | (x mode only) Use the user and group of the user running the program rather than those specified in the archive. Note that this has no significance unless -p is specified, and the program is being run by the root user. In this case, the file modes and flags from the archive will be restored, but ACLs or owner information in the archive will be discarded. |
--one-file-system -( -W one-file-system) |
| (c, r, and u modes) Do not cross mount points. |
-P | Preserve pathnames. By default, absolute pathnames (those that begin with a / character) have the leading slash removed both when creating archives and extracting from them. Also, tar will refuse to extract archive entries whose pathnames contain .. or whose target directory would be altered by a symlink. This option suppresses these behaviors. |
-p | (x mode only) Preserve file permissions. Attempt to restore the full permissions, including owner, file modes, file flags and ACLs, if available, for each item extracted from the archive. By default, newly-created files are owned by the user running tar, the file mode is restored for newly-created regular files, and all other types of entries receive default permissions. If tar is being run by root, the default is to restore the owner unless the -o option is also specified. |
--strip-components count(-W strip-components = count) |
| (x and t mode only) Remove the specified number of leading path elements. Pathnames with fewer elements will be silently skipped. Note that the pathname is edited after checking inclusion/exclusion patterns but before security checks. |
-T filename |
| In x or t mode, tar will read the list of names to be extracted from filename. In c mode, tar will read names to be archived from filename. The special name "-C" on a line by itself will cause the current directory to be changed to the directory specified on the following line. Names are terminated by newlines unless --null is specified. Note that --null also disables the special handling of lines containing "-C". |
-U | (x mode only) Unlink files before creating them. Without this option, tar overwrites existing files, which preserves existing hardlinks. With this option, existing hardlinks will be broken, as will any symlink that would affect the location of an extracted file. |
-v | Produce verbose output. In create and extract modes, tar will list each file name as it is read from or written to the archive. In list mode, tar will produce output similar to that of ls(1). Additional -v options will provide additional detail. |
-W longopt=value |
| Long options (preceded by -- ) are only supported directly on systems that have the getopt_long(3) function. The -W option can be used to access long options on systems that do not support this function. |
-w | Ask for confirmation for every action. |
-X filename |
| Read a list of exclusion patterns from the specified file. See --exclude for more information about the handling of exclusions. |
-y | (c mode only) Compress the resulting archive with bzip2(1). In extract or list modes, this option is ignored. Note that, unlike other tar implementations, this implementation recognizes bzip2 compression automatically when reading archives. |
-z | (c mode only) Compress the resulting archive with gzip(1). In extract or list modes, this option is ignored. Note that, unlike other tar implementations, this implementation recognizes gzip compression automatically when reading archives. |
|