Amiga Unix — 68040 · 68060

Manual pages › General commands (1)

tar(1)

GNU tape archiver

Package: gtar, added for amigaux.

This package comes with the extra set; without it, tar runs heirloom-tar: see heirloom-tar(1); the original page is tar-original(1).

NAME · SYNOPSIS · DESCRIPTION · OPERATIONS · OPTIONS · ENVIRONMENT · AMIX NOTES · EXAMPLES · EXIT STATUS · FILES · BUGS · SEE ALSO

tar - GNU tape archiver

tar operation [option]... [file]...

tar saves many files together in a single archive, and restores single files or all of them from it. This is GNU tar 1.14, installed as /opt/amix/bin/tar. It does not replace the stock SVR4 tar in /usr/sbin, which stays as it is; this one is used when /opt/amix/bin comes before /usr/sbin in PATH.

Exactly one operation is given. Options may be given as long options (--file=archive.tar), as short options (-f archive.tar), or in the old style, bundled into the first argument without a dash (tar cvf archive.tar dir). An argument that is mandatory for a long option is mandatory for its short option too.

The default archive is the standard input or output (-f -), the default record size is 20 blocks of 512 bytes, and the default format for new archives is gnu.

Create a new archive from the named files and directories.
List the members of an archive.
Extract members from an archive.
Report differences between the archive and the file system.
Append files to the end of an archive.
Append only files newer than their copy in the archive.
Append other tar archives to an archive.
Delete members from an archive (not on a tape).

Use archive: a file, a device, or - for standard input or output.
Write records of n x 512 bytes (default 20).
Write records of size bytes, a multiple of 512.
Ignore zeroed blocks in the archive, which normally mean its end.
Reblock as the archive is read (for pipes).
Create, list or extract a multi-volume archive.
Change volumes after n x 1024 bytes.
Run file at the end of each volume (implies -M).
Keep the volume number in file.
Treat an archive name with a colon as a local file.
The remote shell and the remote tape server for a host:file archive; see BUGS.

Filter the archive through gzip, found on PATH. Install the gzip package for it.
Filter the archive through bzip2, found on PATH (the bzip2 package).
Filter the archive through the stock compress.
Filter the archive through program, which must accept -d.

Create the archive in format: v7 (the old V7 format), oldgnu (GNU tar 1.12 and older), gnu (GNU tar 1.13, the default), ustar (POSIX 1003.1-1988) or posix (POSIX 1003.1-2001, pax).
The same as --format=v7.
The same as --format=posix.
Control the pax keywords of a posix archive.
Give a new archive the volume name name; when reading, a pattern the volume name must match.

Change to dir before the following names.
Read the names to archive or extract from file.
The names read by -T are terminated by NUL characters.
Leave out files matching pattern.
Leave out files matching the patterns listed in file.
How exclusion patterns match: from the start of the name (the default) or after any /; case sensitive (the default) or not; with wildcards (the default) or as plain strings; wildcards matching / (the default) or not.
Keep the leading / of file names.
Archive the files symbolic links point to, not the links.
Do not descend into directories.
Stay in the file system of each named directory when creating.
Begin at member name of the archive.
Strip n leading components from member names when extracting.
Archive only files newer than date, a date or the name of a file starting with / or . whose date is taken.
The same, comparing the modification time only.
Handle an old GNU-format incremental backup.
Handle a new GNU-format incremental backup, keeping its state in file.
With --delete, --diff, --extract or --list and named members, act on the nth occurrence of each (default 1).

Do not replace existing files.
Do not replace existing files that are newer than their archive copies.
Overwrite existing files.
Keep the metadata of existing directories.
Remove each file before extracting over it.
Empty a directory hierarchy before extracting a directory over it.
Extract to the standard output.
Do not restore the modification time.
Restore the permissions recorded in the archive.
Do not restore the recorded permissions.
The names to extract are in the archive's order.
The same as -p and -s.
Restore the recorded owners (the default for root), or extract as yourself.
Back up a file before replacing it; see ENVIRONMENT.

Record name as the owner or group of added files.
Record the symbolic mode changes applied to added files.
Record and use numeric user and group ids only.
Keep the access times of archived files.
Handle sparse files efficiently.
Remove files after adding them.
Verify the archive after writing it.
Do not exit non-zero for unreadable files.

List the files processed; twice for a long listing.
Print the bytes written when creating.
Print directory names while reading; report hard links not all archived; print dates in UTC.
Write the verbose output to file.
Show the block number in each message.
Ask before every action.
When creating, the same as --old-archive; when extracting, the same as --no-same-owner.
Print the full option list, or the version, and exit.

Options read before those on the command line.
The backup suffix (default ~) and the kind of backup: t or numbered, nil or existing, never or simple.
Where gzip, bzip2 and compress are found for -z, -j and -Z.

tar reads and writes the base-256 sizes and ids, and the long names, of modern GNU and POSIX archives.

Owner and group names are looked up by tar's own readers of /etc/passwd and /etc/group, not by the stock C library.

An archive id above the range of the SVR4 user id type is read and listed exactly, but the kernel refuses to set it: such a file is extracted owned by root, and tar exits with status 2.

Shrinking an archive in place (--delete) truncates it on a block boundary and writes the tail back, so the stock kernel's truncation fault is not reached.

Create archive.tar from foo and bar.
List archive.tar verbosely.
Extract a gzip-compressed archive into /tmp.

0 on success, 1 when some files differ (--diff), 2 on a fatal error.

/opt/amix/bin/tar
This program.
/opt/amix/doc/tar
Its licence, NEWS and README.

Remote archives (host:file) have no default remote shell in this build: one must be given with --rsh-command, and the remote host must provide rmt (--rmt-command); no rmt is installed here. Remote archives are untested on Amix.

Tape ioctls are not built (the system has no <sys/mtio.h>).

--totals shows the rate as ?/s for a run under one second.

gzip(1), bzip2(1), compress(1). The full manual is GNU tar's texinfo manual; this build ships its NEWS and README in /opt/amix/doc/tar.

2026-10-30 GNU tar 1.14