files to or restore
files from tape.
files are directories, tar acts on the entire subtree.
Options need not be preceded by -.
Note that options are supplied as one group, with any arguments
placed afterward in corresponding order.
Create a new tape.
files to tape.
Print the names of
files if they are stored on the tape (if
not specified, print names of all files).
Add files if not on tape or if modified.
files from tape (if
files not specified, extract
Use blocking factor
n (default is 1; maximum is 20).
Store files in or extract files from archive
arch is usually a device name (default is /dev/mt0).
arch is -, standard input or output is used as appropriate
(e.g., when piping a tar archive to a remote host).
Print error messages about links it can't find.
Follow symbolic links.
Do not restore file modification times; update them to the time of extraction.
Change ownership of extracted files to that of user running program.
Print function letter (
x for extraction or
a for archive)
and name of files.
Wait for user confirmation (y).
Select tape drive
n and use speed
n is 0-7 (default is 0);
c is l (low) h (high) m (medium, the default).
Used to modify
Create an archive of /bin and /usr/bin (c), show the command working (v), and store on the tape in /dev/rmt0:
tar cvf /dev/rmt0 /bin /usr/bin
List the tape's contents in a format like ls -l:
tar tvf /dev/rmt0
Extract the /bin directory:
tar xvf /dev/rmt0 /bin
Create an archive of the current directory, and store it in a file backup.tar on the system.
tar cvf - `find . -print` > backup.tar
(The - tells tar to store the directory on standard output, which is then redirected.)