Name
tar [options
] [files
] — tar
Synopsis
/bin
stdin stdout - file -- opt --help --version
The tar
(tape archive) program does more than read and write files to and from a tape drive:
$ tar -cf /dev/tape myfile1 myfile2
it also lets you create and extract from tar files, which are a standard means of packaging files on Linux and Unix systems:
$ tar -czvf myarchive.tar.gz mydir Create $ tar -tzvf myarchive.tar.gz List contents $ tar -xzvf myarchive.tar.gz Extract
If you specify files on the command line, only those files are processed:
$ tar -xvf /dev/tape file1 file2 file3
Otherwise the entire archive is processed.
Useful options | |
| Create an archive. You’ll have to list the input files and directories on the command line. |
| Append files to an existing archive. |
| Append new/changed files to an existing archive. |
| Append one archive (e.g., a tar file) to the end of another archive: e.g., |
| List the archive. |
| Extract files from the archive. |
| Read the archive from, or write the archive to, the given file. This could be a device (such as /dev/tape) or a plain file if you want to create a traditional Linux tar file. |
| Diff (compare) the archive against the filesystem. |
| Compress (while writing) or uncompress (while reading) the data with |
| Compress (while writing) or uncompress (while reading) the data with |
| Compress (while writing) or uncompress (while reading) the data with Unix |
| Use a block size of |
| Verbose mode: print extra ... |
Get Linux Pocket Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.