www.delorie.com/gnu/docs/tar/tar_39.html   search  
 
Buy GNU books!


GNU tar

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.4.2 tar Options

--absolute-names
-P

Normally when creating an archive, tar strips an initial `/' from member names. This option disables that behavior. @quote-arg -xref{}.

--after-date

(See `--newer'; @quote-arg -pxref{}.)

--atime-preserve

Tells tar to preserve the access time field in a file's inode when dumping it. @quote-arg -xref{}.

--backup=backup-type

Rather than deleting files from the file system, tar will back them up using simple or numbered backups, depending upon backup-type. @quote-arg -xref{}.

--block-number
-R

With this option present, tar prints error messages for read errors with the block number in the archive file. @quote-arg -xref{}.

--blocking-factor=blocking
-b blocking

Sets the blocking factor tar uses to blocking x 512 bytes per record. @quote-arg -xref{}.

--checkpoint

This option directs tar to print periodic checkpoint messages as it reads through the archive. Its intended for when you want a visual indication that tar is still running, but don't want to see `--verbose' output. @quote-arg -xref{}.

--compress
--uncompress
-Z

tar will use the compress program when reading or writing the archive. This allows you to directly act on archives while saving space. @quote-arg -xref{}.

--confirmation

(See `--interactive'; @quote-arg -pxref{}.)

--dereference
-h

When creating a tar archive, tar will archive the file that a symbolic link points to, rather than archiving the symlink. @quote-arg -xref{}.

--directory=dir
-C dir

When this option is specified, tar will change its current directory to dir before performing any operations. When this option is used during archive creation, it is order sensitive. @quote-arg -xref{}.

--exclude=pattern

When performing operations, tar will skip files that match pattern. @quote-arg -xref{}.

--exclude-from=file
-X file

Similar to `--exclude', except tar will use the list of patterns in the file file. @quote-arg -xref{}.

--file=archive
-f archive

tar will use the file archive as the tar archive it performs operations on, rather than tar's compilation dependent default. @quote-arg -xref{}.

--files-from=file
-T file

tar will use the contents of file as a list of archive members or files to operate on, in addition to those specified on the command-line. @quote-arg -xref{}.

--force-local

Forces tar to interpret the filename given to `--file' as a local file, even if it looks like a remote tape drive name. @quote-arg -xref{}.

--group=group

Files added to the tar archive will have a group id of group, rather than the group from the source file. group is first decoded as a group symbolic name, but if this interpretation fails, it has to be a decimal numeric group ID. @quote-arg -xref{}.

Also see the comments for the --owner=user option.

--gunzip

(See `--gzip'; @quote-arg -pxref{}.)

--gzip
--gunzip
--ungzip
-z

This option tells tar to read or write archives through gzip, allowing tar to directly operate on several kinds of compressed archives transparently. @quote-arg -xref{}.

--help

tar will print out a short message summarizing the operations and options to tar and exit. @quote-arg -xref{}.

--ignore-failed-read

Instructs tar to exit successfully if it encounters an unreadable file. See section 4.3.1 Options to Help Read Archives.

--ignore-umask
@quote-arg

(See `--preserve-permissions'; see section 4.3.2 Changing How tar Writes Files.)

--ignore-zeros
-i

With this option, tar will ignore zeroed blocks in the archive, which normally signals EOF. See section 4.3.1 Options to Help Read Archives.

--incremental
-G

Used to inform tar that it is working with an old GNU-format incremental backup archive. It is intended primarily for backwards compatibility only. @quote-arg -xref{}.

--info-script=script-file
--new-volume-script=script-file
-F script-file

When tar is performing multi-tape backups, script-file is run at the end of each tape. @quote-arg -xref{}.

--interactive
--confirmation
-w

Specifies that tar should ask the user for confirmation before performing potentially destructive options, such as overwriting files. @quote-arg -xref{}.

--keep-old-files
-k

When extracting files from an archive, tar will not overwrite existing files if this option is present. See section 4.3.2 Changing How tar Writes Files.

--label=name
-V name

When creating an archive, instructs tar to write name as a name record in the archive. When extracting or listing archives, tar will only operate on archives that have a label matching the pattern specified in name. @quote-arg -xref{}.

--listed-incremental=snapshot-file
-g snapshot-file

During a `--create' operation, specifies that the archive that tar creates is a new GNU-format incremental backup, using snapshot-file to determine which files to backup. With other operations, informs tar that the archive is in incremental format. @quote-arg -xref{}.

--mode=permissions

When adding files to an archive, tar will use permissions for the archive members, rather than the permissions from the files. The program chmod and this tar option share the same syntax for what permissions might be. See section `File permissions' in GNU file utilities. This reference also has useful information for those not being overly familiar with the Unix permission system.

Of course, permissions might be plainly specified as an octal number. However, by using generic symbolic modifications to mode bits, this allows more flexibility. For example, the value `a+rw' adds read and write permissions for everybody, while retaining executable bits on directories or on any other file already marked as executable.

--multi-volume
-M

Informs tar that it should create or otherwise operate on a multi-volume tar archive. @quote-arg -xref{}.

--new-volume-script

(see --info-script)

--newer=date
--after-date=date
-N

When creating an archive, tar will only add files that have changed since date. @quote-arg -xref{}.

--newer-mtime

In conjunction with `--newer', tar will only add files whose contents have changed (as opposed to just `--newer', which will also back up files for which any status information has changed).

--no-recursion

With this option, tar will not recurse into directories unless a directory is explicitly named as an argument to tar. @quote-arg -xref{}.

--null

When tar is using the `--files-from' option, this option instructs tar to expect filenames terminated with NUL, so tar can correctly work with file names that contain newlines. @quote-arg -xref{}.

--numeric-owner

This option will notify tar that it should use numeric user and group IDs when creating a tar file, rather than names. @quote-arg -xref{}.

--old-archive

(See `--portability'; @quote-arg -pxref{}.)

--one-file-system
-l

Used when creating an archive. Prevents tar from recursing into directories that are on different file systems from the current directory. @quote-arg -xref{}.

--owner=user

Specifies that tar should use user as the owner of members when creating archives, instead of the user associated with the source file. user is first decoded as a user symbolic name, but if this interpretation fails, it has to be a decimal numeric user ID. @quote-arg -xref{}.

There is no value indicating a missing number, and `0' usually means root. Some people like to force `0' as the value to offer in their distributions for the owner of files, because the root user is anonymous anyway, so that might as well be the owner of anonymous archives.

--portability
--old-archive
-o

Tells tar to create an archive that is compatible with Unix V7 tar. @quote-arg -xref{}.

--posix

Instructs tar to create a POSIX compliant tar archive. @quote-arg -xref{}.

--preserve

Synonymous with specifying both `--preserve-permissions' and `--same-order'. @quote-arg -xref{}.

--preserve-order

(See `--same-order'; see section 4.3.1 Options to Help Read Archives.)

--preserve-permissions
--same-permissions
-p

When tar is extracting an archive, it normally subtracts the users' umask from the permissions specified in the archive and uses that number as the permissions to create the destination file. Specifying this option instructs tar that it should use the permissions directly from the archive. See section 4.3.2 Changing How tar Writes Files.

--read-full-records
-B

Specifies that tar should reblock its input, for reading from pipes on systems with buggy implementations. See section 4.3.1 Options to Help Read Archives.

--record-size=size

Instructs tar to use size bytes per record when accessing the archive. @quote-arg -xref{}.

--recursive-unlink

Similar to the `--unlink-first' option, removing existing directory hierarchies before extracting directories of the same name from the archive. See section 4.3.2 Changing How tar Writes Files.

--remove-files

Directs tar to remove the source file from the file system after appending it to an archive. @quote-arg -xref{}.

--rsh-command=cmd

Notifies tar that is should use cmd to communicate with remote devices. @quote-arg -xref{}.

--same-order
--preserve-order
-s

This option is an optimization for tar when running on machines with small amounts of memory. It informs tar that the list of file arguments has already been sorted to match the order of files in the archive. See section 4.3.1 Options to Help Read Archives.

--same-owner

When extracting an archive, tar will attempt to preserve the owner specified in the tar archive with this option present. @quote-arg -xref{}.

--same-permissions

(See `--preserve-permissions'; see section 4.3.2 Changing How tar Writes Files.)

--show-omitted-dirs

Instructs tar to mention directories its skipping over when operating on a tar archive. @quote-arg -xref{}.

--sparse
-S

Invokes a GNU extension when adding files to an archive that handles sparse files efficiently. @quote-arg -xref{}.

--starting-file=name
-K name

This option affects extraction only; tar will skip extracting files in the archive until it finds one that matches name. See section 4.3.3 Coping with Scarce Resources.

--suffix=suffix

Alters the suffix tar uses when backing up files from the default `~'. @quote-arg -xref{}.

--tape-length=num
-L num

Specifies the length of tapes that tar is writing as being num x 1024 bytes long. @quote-arg -xref{}.

--to-stdout
-O

During extraction, tar will extract files to stdout rather than to the file system. See section 4.3.2 Changing How tar Writes Files.

--totals

Displays the total number of bytes written after creating an archive. @quote-arg -xref{}.

--touch
-m

Sets the modification time of extracted files to the extraction time, rather than the modification time stored in the archive. See section 4.3.2 Changing How tar Writes Files.

--uncompress

(See `--compress'; @quote-arg -pxref{}.)

--ungzip

(See `--gzip'; @quote-arg -pxref{}.)

--unlink-first
-U

Directs tar to remove the corresponding file from the file system before extracting it from the archive. See section 4.3.2 Changing How tar Writes Files.

--use-compress-program=prog

Instructs tar to access the archive through prog, which is presumed to be a compression program of some sort. @quote-arg -xref{}.

--verbose
-v

Specifies that tar should be more verbose about the operations its performing. This option can be specified multiple times for some operations to increase the amount of information displayed. @quote-arg -xref{}.

--verify
-W

Verifies that the archive was correctly written when creating an archive. @quote-arg -xref{}.

--version

tar will print an informational message about what version it is and a copyright message, some credits, and then exit. @quote-arg -xref{}.

--volno-file=file

Used in conjunction with `--multi-volume'. tar will keep track of which volume of a multi-volume archive its working in file. @quote-arg -xref{}.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster   donations   bookstore     delorie software   privacy  
  Copyright © 2003   by The Free Software Foundation     Updated Jun 2003  

Please take a moment to fill out this visitor survey
You can help support this site by visiting the advertisers that sponsor it! (only once each, though)