|TAR(1)||General Commands Manual||TAR(1)|
blocking-factor | archive | replstr] [
tarcommand creates, adds files to, or extracts files from an archive file in “tar” format. A tar archive is often stored on a magnetic tape, but can be stored equally well on a floppy, CD-ROM, or in a regular disk file. In the first (legacy) form, all option flags except for
-Imust be contained within the first argument to
tarand must not be prefixed by a hyphen (‘-’). Option arguments, if any, are processed as subsequent arguments to
tarand are processed in the order in which their corresponding option flags have been presented on the command line. In the second and preferred form, option flags may be given in any order and are immediately followed by their corresponding option argument values. One of the following flags must be present:
tarwill list all archive members that match each pattern.
tarwill extract all archive members that match each pattern. If more than one copy of a file exists in the archive, later copies will overwrite earlier copies during extraction. The file mode and modification time are preserved if possible. The file mode is subject to modification by the umask(2).
taruses 512-byte blocks. The default is 20, the maximum is 126. Archives with a blocking factor larger than 63 violate the POSIX standard and will not be portable to all systems.
taris unable to decode. This implies the
\n’ (where n is a digit) back-references, or subexpression matching. The old string may also contain newline characters. Any non-null character can be used as a delimiter (‘
/’ is shown here). Multiple
-sexpressions can be specified. The expressions are applied in the order they are specified on the command line, terminating with the first successful substitution. The optional trailing
gcontinues to apply the substitution expression to the pathname substring, which starts with the first character following the end of the last successful substitution. The first unsuccessful substitution stops the operation of the
goption. The optional trailing
pwill cause the final result of a successful substitution to be written to standard error in the following format:
-vis specified multiple times or if the
-toption is also specified,
tarwill use a long format for listing files, similar to ls(1)
tarto prompt the user for the filename to use when storing or extracting files in an archive.
tarutility exits with one of the following values:
$ tar c bonvole sekve
$ tar zcf foriru.tar.gz bonvole sekve
$ tar zcvf backup.tar.gz *.c
$ tar tvzf backup.tar.gz '*.jpeg'
tarcannot create a file or a link when extracting an archive or cannot find a file while writing an archive, or cannot preserve the user ID, group ID, file mode, or access and modification times when the
-poption is specified, a diagnostic message is written to standard error and a non-zero exit value will be returned, but processing will continue. In the case where
tarcannot create a link to a file,
tarwill not create a second copy of the file. If the extraction of a file from an archive is prematurely terminated by a signal or error,
tarmay have only partially extracted the file the user wanted. Additionally, the file modes of extracted files and directories may have incorrect file bits, and the modification and access times may be wrong. If the creation of an archive is prematurely terminated by a signal or error,
tarmay have only partially created the archive, which may violate the specific archive format specification. cpio(1), pax(1)
tarcommand first appeared in Version 7 AT&T UNIX. Keith Muller at the University of California, San Diego.
-Lflags are not portable to other versions of
tarwhere they may have a different meaning.
|October 9, 2017||OpenBSD-6.3|