0% found this document useful (0 votes)
130 views9 pages

Tar PDF

The tar command archives and extracts files from tape or disk. It stores one or more files in a single archive file, creates and appends to archive files, compares archive contents to the file system, and extracts files from archives. Tar supports various compression formats and has many options to modify its behavior, such as file selection, permissions preservation, recursion, and I/O controls.

Uploaded by

antozequiel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
130 views9 pages

Tar PDF

The tar command archives and extracts files from tape or disk. It stores one or more files in a single archive file, creates and appends to archive files, compares archive contents to the file system, and extracts files from archives. Tar supports various compression formats and has many options to modify its behavior, such as file selection, permissions preservation, recursion, and I/O controls.

Uploaded by

antozequiel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

TAR (1)

BSD General Commands Manual

TAR (1)

NAME tar The GNU version of the tar archiving utility SYNOPSIS tar [ ] A catenate concatenate | c create | d diff compare | delete | r append | t list | testlabel | u update | x extract get [ options ] [ pathname . . . ] DESCRIPTION Tar stores and extracts les from a tape or disk archive. The rst argument to tar should be a function; either one of the letters Acdrtux, or one of the long function names. A function letter need not be prexed with , and may be combined with other single-letter options. A long function name must be prexed with . Some options take a parameter; with the singleletter form these must be given as separate arguments. With the long form, they may be given by appending =value to the option. FUNCTION LETTERS Main operation mode: A, catenate, concatenate append tar les to an archive c, create create a new archive d, diff, compare nd differences between archive and le system delete delete from the archive (not on mag tapes!) r, append append les to the end of an archive t, list list the contents of an archive testlabel test the archive volume label and exit u, update only append les newer than copy in archive x, extract, get extract les from an archive OTHER OPTIONS Operation modiers: [07][lmh] specify drive and density a, autocompress use archive sufx to determine the compression program

Mar 31, 2012

TAR (1)

BSD General Commands Manual

TAR (1)

addfile=FILE add given FILE to the archive (useful if its name starts with a dash) anchored patterns match le name start noanchored patterns match after any / (default for exclusion) atimepreserve preserve access times on dumped les, either by restoring the times noautocompress do not use archive sufx to determine the compression program b, blockingfactor BLOCKS BLOCKS x 512 bytes per record B, readfullrecords reblock as we read (for 4.2BSD pipes) backup backup before removal, choose version CONTROL C, directory DIR change to directory DIR checkdevice check device numbers when creating incremental archives (default) nocheckdevice do not check device numbers when creating incremental archives checkpoint display progress messages every NUMBERth record (default 10) checkpointaction=ACTION execute ACTION on each checkpoint delaydirectoryrestore delay setting modication times and permissions of extracted nodelaydirectoryrestore cancel the effect of --delay-directory-restore option exclude=PATTERN exclude les, given as a PATTERN excludebackups exclude backup and lock les excludecaches exclude contents of directories containing CACHEDIR.TAG, excludecachesall exclude directories containing CACHEDIR.TAG excludecachesunder exclude everything under directories containing CACHEDIR.TAG

Mar 31, 2012

TAR (1)

BSD General Commands Manual

TAR (1)

excludetag=FILE exclude contents of directories containing FILE, except excludetagall=FILE exclude directories containing FILE excludetagunder=FILE exclude everything under directories containing FILE excludevcs exclude version control system directories f, file ARCHIVE use archive le or device ARCHIVE F, infoscript, newvolumescript NAME run script at end of each tape (implies -M) forcelocal archive le is local even if it has a colon fulltime print le time to its full resolution g, listedincremental FILE handle new GNU-format incremental backup G, incremental handle old GNU-format incremental backup group=NAME force NAME as group for added les h, dereference follow symlinks; archive and dump the les they point to H, format FORMAT create archive of the given formatFORMAT is one of the following: format=gnu GNU tar 1.13.x format format=oldgnu GNU format as per tar <= 1.12 format=pax POSIX 1003.1-2001 (pax) format format=posix same as pax format=ustar POSIX 1003.1-1988 (ustar) format format=v7 old V7 tar format harddereference follow hard links; archive and dump the les they refer to

Mar 31, 2012

TAR (1)

BSD General Commands Manual

TAR (1)

i, ignorezeros ignore zeroed blocks in archive (means EOF) I, usecompressprogram PROG lter through PROG (must accept -d) ignorecase ignore case noignorecase case sensitive matching (default) ignorecommanderror ignore exit codes of children noignorecommanderror treat non-zero exit codes of children as error ignorefailedread do not exit with nonzero on unreadable les indexfile=FILE send verbose output to FILE j, bzip2 J, xz k, keepoldfiles dont replace existing les when extracting K, startingfile MEMBER-NAME begin at member MEMBER-NAME in the archive keepnewerfiles dont replace existing les that are newer than their archive copies l, checklinks print a message if not all links are dumped L, tapelength NUMBER change tape after writing NUMBER x 1024 bytes level=NUMBER dump level for created listed-incremental archive lzip lzma lzop m, touch dont extract le modied time

Mar 31, 2012

TAR (1)

BSD General Commands Manual

TAR (1)

M, multivolume create/list/extract multi-volume archive mode=CHANGES force (symbolic) mode CHANGES for added les mtime=DATE-OR-FILE set mtime for added les from DATE-OR-FILE n, seek archive is seekable N, newer, afterdate DATE-OR-FILE only store les newer than DATE-OR-FILE newermtime=DATE compare date and time when data changed only null -T reads null-terminated names, disable -C nonull disable the effect of the previous --null option numericowner always use numbers for user/group names O, tostdout extract les to standard output occurrence process only the NUMBERth occurrence of each le in the archive; oldarchive, portability same as --format=v7 onefilesystem stay in local le system when creating archive overwrite overwrite existing les when extracting overwritedir overwrite metadata of existing directories when extracting (default) nooverwritedir preserve metadata of existing directories owner=NAME force NAME as owner for added les p, preservepermissions, samepermissions extract information about le permissions (default for superuser) P, absolutenames dont strip leading /s from le names paxoption=keyword[[:]=value][,keyword[[:]=value]]... control pax keywords

Mar 31, 2012

TAR (1)

BSD General Commands Manual

TAR (1)

posix same as --format=posix preserve same as both -p and -s quotechars=STRING additionally quote characters from STRING noquotechars=STRING disable quoting for characters from STRING quotingstyle=STYLE set name quoting style; see below for valid STYLE values R, blocknumber show block number within archive with each message recordsize=NUMBER NUMBER of bytes per record, multiple of 512 recursion recurse into directories (default) norecursion avoid descending automatically in directories recursiveunlink empty hierarchies prior to extracting directory removefiles remove les after adding them to the archive restrict disable use of some potentially harmful options rmtcommand=COMMAND use given rmt COMMAND instead of rmt rshcommand=COMMAND use remote COMMAND instead of rsh s, preserveorder, sameorder sort names to extract to match archive S, sparse handle sparse les efciently sameowner try extracting les with the same ownership as exists in the archive (default for superuser) nosameowner extract les as yourself (default for ordinary users) nosamepermissions apply the users umask when extracting permissions from the archive (default for ordinary users) noseek archive is not seekable

Mar 31, 2012

TAR (1)

BSD General Commands Manual

TAR (1)

showdefaults show tar defaults showomitteddirs when listing or extracting, list each directory that does not match search criteria showtransformednames, showstorednames show le or archive names after transformation sparseversion=MAJOR[.MINOR] set version of the sparse format to use (implies --sparse) stripcomponents=NUMBER strip NUMBER leading components from le names on extraction suffix=STRING backup before removal, override usual sufx ( unless overridden by environment variable SIMPLE_BACKUP_SUFFIX) T, filesfrom FILE get names to extract or create from FILE tocommand=COMMAND pipe extracted les to another program totals print total bytes after processing the archive; transform, xform EXPRESSION use sed replace EXPRESSION to transform le names U, unlinkfirst remove each le prior to extracting over it unquote unquote lenames read with -T (default) nounquote do not unquote lenames read with -T utc print le modication times in UTC v, verbose verbosely list les processed V, label TEXT create archive with volume name TEXT; at list/extract time, use TEXT as a globbing pattern for volume name volnofile=FILE use/update the volume number in FILE w, interactive, confirmation ask for conrmation for every action W, verify attempt to verify the archive after writing it

Mar 31, 2012

TAR (1)

BSD General Commands Manual

TAR (1)

warning=KEYWORD warning control wildcards use wildcards (default for exclusion) wildcardsmatchslash wildcards match / (default for exclusion) nowildcardsmatchslash wildcards do not match / nowildcards verbatim string matching X, excludefrom FILE exclude patterns listed in FILE z, gzip, gunzip ungzip Z, compress, uncompress

ENVIRONMENT The behavior of tar is controlled by the following environment variables, among others: SIMPLE_BACKUP_SUFFIX Backup prex to use when extracting, if suffix is not specied. The backup sufx defaults to if neither is specied. TAR_OPTIONS Options to prepend to those specied on the command line, separated by whitespace. Embedded backslashes may be used to escape whitespace or backslashes within an option. TAPE Device or le to use for the archive if file is not specied. If this environment variable is unset, use stdin or stdout instead.

TAR_LONGLINK_100 EXAMPLES Create archive.tar from les foo and bar. tar cf archive.tar foo bar List all les in archive.tar verbosely. tar tvf archive.tar Extract all les from archive.tar. tar xf archive.tar SEE ALSO tar(5), symlink(7), rmt(8) HISTORY The tar command appeared in Version 7 AT&T UNIX. BUGS The GNU folks, in general, abhor man pages, and create info documents instead. Unfortunately, the info document describing tar is licensed under the GFDL with invariant cover texts, which makes it impossible to

Mar 31, 2012

TAR (1)

BSD General Commands Manual

TAR (1)

include any text from that document in this man page. Most of the text in this document was automatically extracted from the usage text in the source. It may not completely describe all features of the program.

Mar 31, 2012

You might also like