Home Explore Blog CI



man-pages

6th chunk of `tar.man`
3246ce501163e0dca582f4866ed47085b3f7495d8f5dba850000000100000fb9
 UID of the file owner.

              TAR_GID
                     GID of the file owner.

              Additionally, the following variables contain information about tar operation mode and the archive being processed:

              TAR_VERSION
                     GNU tar version number.

              TAR_ARCHIVE
                     The name of the archive tar is processing.

              TAR_BLOCKING_FACTOR
                     Current blocking factor, i.e. number of 512‐byte blocks in a record.

              TAR_VOLUME
                     Ordinal number of the volume tar is processing (set if reading a multi‐volume archive).

              TAR_FORMAT
                     Format of the archive being processed.  One of: gnu, oldgnu, posix, ustar, v7.

              TAR_SUBCOMMAND
                     A short option (with a leading dash) describing the operation tar is executing.

   Handling of file attributes
       --atime-preserve[=METHOD]
              Preserve access times on dumped files, either by restoring the times after reading (METHOD=replace, this is the default) or by not setting the times in the first place (METHOD=system)

       --delay-directory-restore
              Delay setting modification times and permissions of extracted directories until the end of extraction.  Use this option when extracting from an archive which has unusual member ordering.

       --group=NAME[:GID]
              Force NAME as group for added files.  If GID is not supplied, NAME can be either a user name or numeric GID.  In this case the missing part (GID or name) will be inferred from the current host’s group database.

              When used with --group-map=FILE, affects only those files whose owner group is not listed in FILE.

       --group-map=FILE
              Read  group translation map from FILE.  Empty lines are ignored.  Comments are introduced with # sign and extend to the end of line.  Each non‐empty line in FILE defines translation for a single group.  It must
              consist of two fields, delimited by any amount of whitespace:

              OLDGRP NEWGRP[:NEWGID]

              OLDGRP is either a valid group name or a GID prefixed with +.  Unless NEWGID is supplied, NEWGRP must also be either a valid group name or a +GID.  Otherwise, both NEWGRP and NEWGID need not be  listed  in  the
              system group database.

              As a result, each input file with owner group OLDGRP will be stored in archive with owner group NEWGRP and GID NEWGID.

       --mode=CHANGES
              Force symbolic mode CHANGES for added files.

       --mtime=DATE‐OR‐FILE
              Set mtime for added files.  DATE‐OR‐FILE is either a date/time in almost arbitrary format, or the name of an existing file.  In the latter case the mtime of that file will be used.

       -m, --touch
              Don’t extract file modified time.

       --no-delay-directory-restore
              Cancel the effect of the prior --delay-directory-restore option.

       --no-same-owner
              Extract files as yourself (default for ordinary users).

       --no-same-permissions
              Apply the user’s umask when extracting permissions from the archive (default for ordinary users).

       --numeric-owner
              Always use numbers for user/group names.

       --owner=NAME[:UID]
              Force NAME as owner for added files.  If UID is not supplied, NAME can be either a user name or numeric UID.  In this case the missing part (UID or name) will be inferred from the current host’s user database.

              When used with --owner-map=FILE, affects only those files whose owner is not listed in FILE.

       --owner-map=FILE
              Read  owner  translation  map from FILE.  Empty lines are ignored.  Comments are introduced with # sign and extend to the end of line.  Each non‐empty line in FILE defines translation for a single UID.  It must
              consist of two fields, delimited by any amount

Title: GNU tar: Additional Environment Variables and File Attribute Handling Details
Summary
This section elaborates on the environment variables provided when using '--to-command', including TAR_UID, TAR_GID, TAR_VERSION, TAR_ARCHIVE, TAR_BLOCKING_FACTOR, TAR_VOLUME, TAR_FORMAT, and TAR_SUBCOMMAND. It then provides further details on handling file attributes using options like --atime-preserve, --delay-directory-restore, --group, --group-map, --mode, --mtime, --touch, --no-same-owner, --no-same-permissions, --numeric-owner and --owner, which allow for modifying file attributes (timestamps, ownership, permissions) during archive creation and extraction.