1TAR(1)                      General Commands Manual                     TAR(1)
2
3
4

NAME

6       tar - tape archiver
7

SYNOPSIS

9       tar [ key ] [ name ... ]
10

DESCRIPTION

12       Tar  saves and restores multiple files on a single file (usually a mag‐
13       netic tape, but it can be any file).  Tar's actions are  controlled  by
14       the key argument.  The key is a string of characters containing at most
15       one function letter and possibly one or more function modifiers.  Other
16       arguments  to tar are file or directory names specifying which files to
17       dump or restore.  In all cases, appearance of a directory  name  refers
18       to the files and (recursively) subdirectories of that directory.
19
20       The  function  portion  of the key is specified by one of the following
21       letters:
22
23       r       The named files are written on the end  of  the  tape.   The  c
24               function implies this.
25
26       x       The named files are extracted from the tape.  If the named file
27               matches a directory whose contents had been  written  onto  the
28               tape,  this  directory  is (recursively) extracted.  The owner,
29               modification time, and mode are restored (if possible).  If  no
30               file  argument  is  given,  the  entire  content of the tape is
31               extracted.  Note that if multiple entries specifying  the  same
32               file are on the tape, the last one overwrites all earlier.
33
34       t       The  names  of  the  specified  files are listed each time they
35               occur on the tape.  If no file argument is given,  all  of  the
36               names on the tape are listed.
37
38       u       The  named  files  are added to the tape if either they are not
39               already there or have been modified since last put on the tape.
40
41       c       Create a new tape; writing begins on the beginning of the  tape
42               instead of after the last file.  This command implies r.
43
44       The  following  characters  may be used in addition to the letter which
45       selects the function desired.
46
47       o         On output, tar normally places information  specifying  owner
48                 and  modes of directories in the archive.  Former versions of
49                 tar, when encountering this information will give error  mes‐
50                 sage of the form
51                      "<name>/: cannot create".
52                 This modifier will suppress the directory information.
53
54       p         This  modifier says to restore files to their original modes,
55                 ignoring the present umask(2).  Setuid and sticky information
56                 will also be restored to the super-user.
57
58       0, ..., 9 This modifier selects an alternate drive on which the tape is
59                 mounted.  The default is drive 0 at 1600 bpi, which  is  nor‐
60                 mally /dev/rmt8.
61
62       v         Normally  tar does its work silently.  The v (verbose) option
63                 makes tar print the name of each file it treats  preceded  by
64                 the function letter.  With the t function, the verbose option
65                 gives more information about the tape entries than just their
66                 names.
67
68       w         Tar prints the action to be taken followed by file name, then
69                 wait for user confirmation. If a word beginning with  `y'  is
70                 given, the action is done. Any other input means don't do it.
71
72       f         Tar uses the next argument as the name of the archive instead
73                 of /dev/rmt?. If the name of the file is `-', tar  writes  to
74                 standard  output  or  reads from standard input, whichever is
75                 appropriate. Thus, tar can be used as the head or tail  of  a
76                 filter  chain.  Tar can also be used to move hierarchies with
77                 the command
78                         cd fromdir; tar cf - . | (cd todir; tar xf -)
79
80       b         Tar uses the next argument as the blocking  factor  for  tape
81                 records.  The default is 20 (the maximum). This option should
82                 only be used with raw magnetic tape archives (See  f  above).
83                 The block size is determined automatically when reading tapes
84                 (key letters `x' and `t').
85
86       l         tells tar to complain if it cannot resolve all of  the  links
87                 to the files dumped.  If this is not specified, no error mes‐
88                 sages are printed.
89
90       m         tells tar not to restore the modification times.  The modifi‐
91                 cation time will be the time of extraction.
92
93       h         Force  tar  to  follow  symbolic links as if they were normal
94                 files or directories.  Normally, tar does not follow symbolic
95                 links.
96
97       B         Forces  input  and  output  blocking to 20 blocks per record.
98                 This option was added so that tar can work across a  communi‐
99                 cations channel where the blocking may not be maintained.
100
101       C         If  a  file  name  is preceded by -C, then tar will perform a
102                 chdir(2) to that file name.  This allows multiple directories
103                 not  related  by  a  close common parent to be archived using
104                 short relative path names.  For  example,  to  archive  files
105                 from /usr/include and from /etc, one might use
106                      tar c -C /usr include -C / etc
107
108       Previous  restrictions  dealing with tar's inability to properly handle
109       blocked archives have been lifted.
110

FILES

112       /dev/rmt?
113       /tmp/tar*
114

SEE ALSO

116       tar(5)
117

DIAGNOSTICS

119       Complaints about bad key characters and tape read/write errors.
120       Complaints if enough memory is not available to hold the link tables.
121

BUGS

123       There is no way to ask for the n-th occurrence of a file.
124       Tape errors are handled ungracefully.
125       The u option can be slow.
126       The current limit on file name length is 100 characters.
127       There is no way selectively to follow symbolic links.
128       When extracting tapes created with the r or u options, directory  modi‐
129       fication times may not be set correctly.
130
131
132
1337th Edition                      May 12, 1986                           TAR(1)
Impressum