Home Explore Blog CI



man-pages

7th chunk of `tar.man`
6dc68ca18af75964683f9679aa93d4b08c580f9c2fa2c8f40000000100000fc3
 --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 of whitespace:

              OLDUSR NEWUSR[:NEWUID]

              OLDUSR is either a valid user name or a UID prefixed with +.  Unless NEWUID is supplied, NEWUSR must also be either a valid user name or a +UID.  Otherwise, both NEWUSR and NEWUID need not be listed in the sys‐
              tem user database.

              As a result, each input file owned by OLDUSR will be stored in archive with owner name NEWUSR and UID NEWUID.

       -p, --preserve-permissions, --same-permissions
              extract information about file permissions (default for superuser)

       --same-owner
              Try extracting files with the same ownership as exists in the archive (default for superuser).

       -s, --preserve-order, --same-order
              Sort names to extract to match archive

       --sort=ORDER
              When creating an archive, sort directory entries according to ORDER, which is one of none, name, or inode.

              The default is --sort=none, which stores archive members in the same order as returned by the operating system.

              Using --sort=name ensures the member ordering in the created archive is uniform and reproducible.

              Using --sort=inode reduces the number of disk seeks made when creating the archive and thus can considerably speed up archivation.  This sorting order is supported only if the  underlying  system  provides  the
              necessary information.

   Extended file attributes
       --acls Enable POSIX ACLs support.

       --no-acls
              Disable POSIX ACLs support.

       --selinux
              Enable SELinux context support.

       --no‐selinux
              Disable SELinux context support.

       --xattrs
              Enable extended attributes support.

       --no-xattrs
              Disable extended attributes support.

       --xattrs-exclude=PATTERN
              Specify the exclude pattern for xattr keys.  PATTERN is a POSIX regular expression, e.g. --xattrs-exclude=’^user.’, to exclude attributes from the user namespace.

       --xattrs-include=PATTERN
              Specify the include pattern for xattr keys.  PATTERN is a POSIX regular expression.

   Device selection and switching
       -f, --file=ARCHIVE
              Use  archive  file or device ARCHIVE.  If this option is not given, tar will first examine the environment variable ‘TAPE’.  If it is set, its value will be used as the archive name.  Otherwise, tar will assume
              the compiled‐in default.  The default value can be inspected either using the --show-defaults option, or at the end of the tar --help output.

              An archive name that has a colon in it specifies a file or device on a remote machine.  The part before the colon is taken as the machine name or IP address, and the part after it as the file  or  device  path‐
              name, e.g.:

              ‐‐file=remotehost:/dev/sr0

              An optional username can be prefixed to the hostname,

Title: GNU tar: File Ownership, Permissions, Ordering, Extended Attributes, and Device Selection
Summary
This section details options for controlling file ownership and permissions during extraction, including disabling preservation of original ownership and permissions (--no-same-owner, --no-same-permissions), forcing numeric UIDs/GIDs (--numeric-owner), and mapping owners/groups (--owner, --owner-map, --group-map). It also covers options for preserving file permissions (--preserve-permissions), sorting archive members (--sort), and managing extended file attributes like ACLs, SELinux contexts, and xattrs (--acls, --selinux, --xattrs). Finally, it describes how to specify the archive file or device using the --file option, including remote devices.