Home
Search all pages
Subjects
By activity
Professions, Sciences, Humanities, Business, ...
User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...
Text Strings
Conversions, tests, processing, manipulation,...
Math
Integer, Floating point, Matrix, Statistics, Boolean, ...
Processing
Algorithms, Memory, Process control, Debugging, ...
Stored Data
Data storage, Integrity, Encryption, Compression, ...
Communications
Networks, protocols, Interprocess, Remote, Client Server, ...
Hard World Timing, Calendar and Clock, Audio, Video, Printer, Controls...
File System
Management, Filtering, File & Directory access, Viewers, ...
|
|
|
RocketLink!--> Man page versions:
OpenBSD
FreeBSD
NetBSD
RedHat
Solaris
Others
TAR(1) OpenBSD Reference Manual TAR(1)
NAME
tar - tape archiver
SYNOPSIS
tar [-]{crtux}[-befhmopqvwzHLOPXZ014578] [archive] [blocksize] [-C
directory] [-T file] [-s replstr] file1 [file2 ...]
DESCRIPTION
The tar command creates, adds files to, or extracts files from an archive
file in tar format. A tar archive is often stored on a magnetic tape,
but can be a floppy or a regular disk file.
One of the following flags must be present:
-c Create new archive, or overwrite an existing archive,
adding the specified files to it.
-r Append the named new files to existing archive. Note that
this will only work on media on which an end-of-file mark
can be overwritten.
-t List contents of archive. If any files are named on the
command line, only those files will be listed.
-u Alias for -r.
-x Extract files from archive. If any files are named on the
command line, only those files will be extracted from the
archive. If more than one copy of a file exists in the
archive, later copies will overwrite earlier copies during
extraction. The file mode and modification time are pre-
served if possible. The file mode is subject to modifica-
tion by the umask(2).
In addition to the flags mentioned above, any of the following flags may
be used:
-b blocking factor
Set blocking factor to use for the archive. tar uses 512
byte blocks. The default is 20, the maximum is 126.
Archives with a blocking factor larger 63 violate the POSIX
standard and will not be portable to all systems.
-e Stop after first error.
-f archive Filename where the archive is stored. Defaults to
/dev/rst0.
-h Follow symbolic links as if they were normal files or di-
rectories.
-m Do not preserve modification time.
-O Write old-style (non-POSIX) archives.
-o Don't write directory information that the older (V7) style
tar is unable to decode. This implies the -O flag.
-p Preserve user and group ID as well as file mode regardless
of the current umask(2). The setuid and setgid bits are
only preserved if the user is the superuser. Only meaning-
ful in conjunction with the -x flag.
-q Select the first archive member that matches each pattern
operand. No more than one archive member is matched for
each pattern. When members of type directory are matched,
the file hierarchy rooted at that directory is also
matched.
-s replstr Modify the file or archive member names specified by the
pattern or file operands according to the substitution ex-
pression replstr, using the syntax of the ed(1) utility
regular expressions. The format of these regular expres-
sions are:
/old/new/[gp]
As in ed(1), old is a basic regular expression and new can
contain an ampersand (&), \n (where n is a digit) back-ref-
erences, or subexpression matching. The old string may al-
so contain <newline> characters. Any non-null character
can be used as a delimiter (/ is shown here). Multiple -s
expressions can be specified. The expressions are applied
in the order they are specified on the command line, termi-
nating with the first successful substitution. The option-
al trailing g continues to apply the substitution expres-
sion to the pathname substring which starts with the first
character following the end of the last successful substi-
tution. The first unsuccessful substitution stops the oper-
ation of the g option. The optional trailing p will cause
the final result of a successful substitution to be written
to standard error in the following format:
<original pathname> >> <new pathname>
File or archive member names that substitute to the empty
string are not selected and will be skipped.
-v Verbose operation mode.
-w Interactively rename files. This option causes tar to
prompt the user for the filename to use when storing or ex-
tracting files in an archive.
-z Compress archive using gzip.
-C directory This is a positional argument which sets the working direc-
tory for the following files. When extracting, files will
be extracted into the specified directory; when creating,
the specified files will be matched from the directory.
-H Follow symlinks given on command line only.
-L Follow all symlinks.
-P Do not strip leading slashes (`/') from pathnames. The de-
fault is to strip leading slashes.
-T file This is a positional argument which reads the names of
files to archive or extract from the given file.
-X Do not cross mount points in the file system.
-Z Compress archive using compress.
The options [-014578] can be used to select one of the compiled-in backup
devices, /dev/rstN.
FILES
/dev/rst0 default archive name
SEE ALSO
cpio(1), pax(1)
AUTHOR
Keith Muller at the University of California, San Diego.
ERRORS
tar will exit with one of the following values:
0 All files were processed successfully.
1 An error occurred.
Whenever tar cannot create a file or a link when extracting an archive or
cannot find a file while writing an archive, or cannot preserve the user
ID, group ID, file mode or access and modification times when the -p op-
tion is specified, a diagnostic message is written to standard error and
a non-zero exit value will be returned, but processing will continue. In
the case where tar cannot create a link to a file, tar will not create a
second copy of the file.
If the extraction of a file from an archive is prematurely terminated by
a signal or error, tar may have only partially extracted the file the us-
er wanted. Additionally, the file modes of extracted files and directo-
ries may have incorrect file bits, and the modification and access times
may be wrong.
If the creation of an archive is prematurely terminated by a signal or
error, tar may have only partially created the archive which may violate
the specific archive format specification.
OpenBSD 2.6 June 11, 1996 3
Source: OpenBSD 2.6 man pages. Copyright: Portions are copyrighted by BERKELEY SOFTWARE DESIGN, INC., The Regents of the University of California, Massachusetts Institute of Technology, Free Software Foundation, FreeBSD Inc., and others. |
(Corrections, notes, and links courtesy of RocketAware.com)
GNU Sources for tar(1) (at FreeBSD cvsweb) GNU sources for tar(1) (at OpenBSD cvsweb)
Up to: File Access - Operations affecting a file as a whole. (delete files, rename, truncate, etc.)
Up to: File Transfer and Distribution - Protocols and Methods of transfering files and directories, distributing and installing software. (file collections and archives, FTP, cvsup, NFS, et al.)
RocketLink!--> Man page versions:
OpenBSD
FreeBSD
NetBSD
RedHat
Solaris
Others
Rapid-Links:
Search | About | Comments | Submit Path: RocketAware >
tar.1/
RocketAware.com is a service of Mib Software Copyright 1999, Forrest J. Cavalier III. All Rights Reserved. We welcome submissions and comments
|