O'Reilly logo

Unix in a Nutshell, 4th Edition by Arnold Robbins

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] [files]

Copy files to or restore files from tape (tape archive). If any files are directories, tar acts on the entire subtree. (See also cpio and pax.)

Options are supplied as one group, with any arguments placed afterward in corresponding order. Originally, tar did not even accept a leading - on its options. Although the Solaris version allows one, it does not require it. On many other Unix systems, you may use conventional option notation, with each option preceded by a dash and separated from the other options with whitespace. Some systems actually require the use of separate options. Check your local documentation for the final word.

GNU/Linux and Mac OS X both use the GNU version of tar which accepts all the common options, and also has many options of its own.

Notes

For the following reasons, tar is best used as a way to exchange file or source code archives over a network. A system administrator performing system backups is advised to use the vendor-supplied backup program (typically called dump or backup; see your local documentation) for backups instead of tar. (Many of these same points apply to cpio and to pax as well.)

  • Most Unix versions of tar preserve the leading / from an absolute filename in the archive. This makes it difficult or impossible to extract the files on a different system.

  • The tar archive format was designed when Unix file and directory names were short (14 characters maximum). Modern Unix systems allow individual filenames to ...

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