

tar.gz is always handled as if the -gzip option had been specified (see -gzip, below).Īdd file to the archive.
Unix tar compress folder to another directory archive#
For example, if this option is specified, an archive with the extension. Use the archive's suffix to determine the compression program.

(If you're not sure what this means, you don't need to use this option.) The following options specify the way tar operates:. (This function doesn't work on magnetic tapes).Īppend files to the end of a tar archive.Īppend files, but only those that are newer than the copy in the archive. Specifying one of the following functions selects what tar's main mode of operation will be: A, -catenate,Ĭalculate any differences between the archive and the file system.ĭelete from the archive. With the long form, they may be given by appending " = value" to the option.įor example, the following commands are all equivalent: tar -create -file=archive.tar file1 file2 tar -c -f archive.tar file1 file2 tar -cf archive.tar file1 file2 tar cf archive.tar file1 file2 Functions Some options take a parameter with the single-letter form these must be given as separate arguments. A long function name must be prefixed with a double dash (" -"). A function letter does not need to be prefixed with a dash (" -"), and may be combined with other single-letter options. The first argument to tar should be a function specification: either one of the letters A, c, d, r, t, u, or x, or one of the long function names. delete | r -append | t -list | -test-label | u -update | Syntax tar A -catenate -concatenate | c -create | d -diff -compare | This documentation covers the GNU version of tar, which is included with most modern variants of the Linux operating system. It was later formalized as part of the POSIX standard, and today is used to collect, distribute, and archive files, while preserving file system attributes such as user and group permissions, access and modification dates, and directory structures. Tar was originally developed in the early days of Unix for the purpose of backing up files to tape-based storage devices.
