PAXTAR(1)
π NAME π
paxtar β tape archiver
okay so bestie, welcome to paxtar(1) from the General Commands Manual β it's the tape archiver, and we're gonna make it make sense. no cap. π«Ά
β¨ SYNOPSIS β¨
paxtar {crtux}[014578abefHhJjLmOoPpqsvwXZz]
[blocking-factor | archive | replstr] [-C directory] [-I file]
[file ...]
paxtar {-crtux} [-014578aeHhJjLmOoPpqvwXZz] [-b blocking-factor]
[-C directory] [-D format-options] [-f archive] [-I file]
[-M flag] [-s replstr] [file ...]
π DESCRIPTION π
The paxtar command creates, adds files to, or extracts files from an archive file in βtarβ (strictly speaking, ustar) format. A tar archive is often stored on a magnetic tape, but can be stored equally well on a floppy, CD-ROM, or in a regular disk file.
In the first (legacy) form, all option flags except for -C and -I must be contained within the first argument to paxtar and must not be prefixed by a hyphen (β-β). Option arguments, if any, are processed as subsequent arguments to paxtar and are processed in the order in which their corresponding option flags have been presented on the command line.
In the second and preferred form, option flags may be given in any order and are immediately followed by their corresponding option argument values.
One of the following flags must be present:
-cβ Create new archive, or overwrite an existing archive, adding the specified files to it.-rβ Append the named new files to existing archive. Note that this will only work on media on which an end-of-file mark can be overwritten.-tβ List contents of archive. If any files are named on the command line, only those files will be listed. The file arguments may be specified as glob patterns (seeglob(7)for more information), in which casepaxtarwill list all archive members that match each pattern.-uβ Alias for-r.-xβ Extract files from archive. If any files are named on the command line, only those files will be extracted from the archive. The file arguments may be specified as glob patterns (seeglob(7)for more information), in which casepaxtarwill extract all archive members that match each pattern.
If more than one copy of a file exists in the archive, later copies will overwrite earlier copies during extraction. The file mode and modification time are preserved if possible. The file mode is subject to modification by umask(2).
In addition to the flags mentioned above, any of the following flags may be used:
-aβ Guess the compression utility based on the archive filename. Inability to guess will result in quietly not using any compression. This option only exists for semi-compatibility with GNU tar; it is strongly recommended to archive to stdout and pipe into an external compression utility with appropriate arguments instead:
tar -cf - foo | xz -2e >foo.txz
-bblocking-factor β Set blocking factor to use for the archive.paxtaruses 512-byte blocks. The default is 20, the maximum is 126. Archives with a blocking factor larger than 63 violate the POSIX standard and will not be portable to all systems.-Cdirectory β This is a positional argument which sets the working directory for the following files. When extracting, files will be extracted into the specified directory; when creating, the specified files will be matched from the directory.-Dformat-options β Specify the archive format and format options, separated by comma.paxtarcurrently supports the following formats and options:arβ The Unix Archiver library format. This format matches APT repositories and the BSDar(1)specification, not GNU binutils (which can however read them) or SYSV systems. Seear(5)on some operating systems for more information.bcpioβ The old binary cpio format. The default blocksize for this format is 5120 bytes. This format is not very portable and should not be used when other formats are available. Inode and device information about a file (used for detecting file hard links by this format), which may be truncated by this format, is detected bypaxtarand is repaired.cpioβ The extended cpio interchange format specified in the IEEE Std 1003.2 (βPOSIX.2β) standard. The default blocksize for this format is 5120 bytes. Inode and device information about a file (used for detecting file hard links by this format), which may be truncated by this format, is detected bypaxtarand is repaired.sv4cpioβ The System V release 4 cpio. The default blocksize for this format is 5120 bytes. Inode and device information about a file (used for detecting file hard links by this format), which may be truncated by this format, is detected bypaxtarand is repaired.sv4crcβ The System V release 4 cpio with file CRC checksums. The default blocksize for this format is 5120 bytes. Inode and device information about a file (used for detecting file hard links by this format), which may be truncated by this format, is detected bypaxtarand is repaired.tarβ The old BSD tar format as found in 4.3BSD. The default blocksize for this format is 10240 bytes. Pathnames stored by this format must be 100 characters or less in length. Only regular files, hard links, symlinks and directories will be archived (other filesystem types are not supported).
For backwards compatibility with even older tar formats, the write_opt=nodir option can be used when writing an archive to omit the storage of directories.
ustarβ The extended tar interchange format specified in the IEEE Std 1003.2 (βPOSIX.2β) standard. The default blocksize for this format is 10240 bytes. Filenames stored by this format must be 100 characters or less in length; the total pathname must be 256 characters or less.
paxtar will detect and report any file that it is unable to store or extract as the result of any specific archive format restrictions. The individual archive formats may impose additional restrictions on use. Typical archive format restrictions include (but are not limited to): file pathname length, file size, link pathname length, and the type of the file.
-eβ Stop after the first error.-farchive β Filename where the archive is stored. Defaults to/dev/rst0. If set to hyphen (β-β) standard output is used. See also theTAPEenvironment variable.-Hβ Follow symlinks given on the command line only.-hβ Follow symbolic links as if they were normal files or directories. In extract mode this means that a directory entry in the archive will not overwrite an existing symbolic link, but rather what the link ultimately points to.-Ifile β This is a positional argument which reads the names of files to archive or extract from the given file, one per line.-Jβ Use thexzutility to compress the archive.-jβ Use thebzip2utility to compress the archive.-Lβ Synonym for the-hoption.-Mflag β Configure the archive normaliser. flag is either a numeric value compatible tostrtonum(3)which is directly stored in the flags word, or one of the following values, optionally prefixed with βno-β to turn them off:inodes0x0001: Serialise inodes, zero device info. (cpio,sv4cpio,sv4crc)links0x0002: Store content of hard links only once. (cpio,sv4cpio,sv4crc)mtime0x0004: Zero out the file modification time. (ar,cpio,sv4cpio,sv4crc,ustar)uidgid0x0008: Set owner to0:0(root:wheel). (ar,cpio,sv4cpio,sv4crc,ustar)verb0x0010: Debug this option.debug0x0020: Debug file header storage.lncp0x0040: Extract hard links by copy if link fails.numid0x0080: Use only numeric uid and gid values. (ustar)gslash0x0100: Append a slash after directory names. (ustar)set0x0003: Keep ownership and mtime intact.dist0x008B: Clean everything except mtime.norm0x008F: Clean everything.root0x0089: Clean owner and device information.
When creating an archive and verbosely listing output, these normalisation operations are not reflected in the output, because they are made only after the output has been shown.
This option is only implemented for the ar, cpio, sv4cpio, sv4crc, and ustar file format writing routines.
-mβ Do not preserve modification time.-Oβ If reading, extract files to standard output. If writing, write old-style (non-POSIX) archives.-oβ If writing, write old-style (non-POSIX) archives. Don't write directory information that the older (V7) style tar is unable to decode. Same as-D tar,write_opt=nodir.-Pβ For security reasons,paxtarskips pathnames containing dotdot (β..β) components and strips leading slashes (β/β) from pathnames by default; this option disables that behaviour.-pβ Preserve user and group ID as well as file mode regardless of the currentumask(2). The setuid and setgid bits are only preserved if the user and group ID could be preserved. Only meaningful in conjunction with the-xflag.-qβ Select the first archive member that matches each file operand. No more than one archive member is matched for each file. When members of type directory are matched, the file hierarchy rooted at that directory is also matched.-sreplstr β bestie, this one modifies archive member names according to the substitution expression replstr, using the syntax ofed(1)utility regular expressions. You can also pass file arguments to restrict the list of archive members to just the ones you specified. π
The format of these regular expressions is:
/old/new/[gp]
Just like in ed(1), old is a basic regular expression (peep re_format(7)), and new can contain an ampersand (&), \n (where n is a digit) back-references, or subexpression matching. The old string may also contain newline characters. Any non-null character can be used as a delimiter (/ is shown here, but you do you). Multiple -s expressions can be specified. The expressions are applied in the order they are specified on the command line, and they terminate with the first successful substitution. β¨
The optional trailing g continues to apply the substitution expression to the pathname substring, which starts with the first character following the end of the last successful substitution. The first unsuccessful substitution stops the operation of the g option. The optional trailing p will cause the final result of a successful substitution to be written to standard error in the following format:
original-pathname >> new-pathname
File or archive member names that substitute to the empty string are not selected and will be skipped. Bye bestie π
-vβ Verbose operation mode. If-vis specified multiple times, or if the-toption is also specified,paxtarwill use a long format for listing files, similar tols(1) -l. It's giving detailed receipts. π-wβ Interactively rename files. This option causespaxtarto prompt the user for the filename to use when storing or extracting files in an archive. So you get to pick the name, main character energy. π-Xβ Do not cross mount points in the filesystem. Stay in your lane. π§-Zβ Use thecompress(1)utility to compress the archive.-zβ Use thegzip(1)utility to compress the archive.
Also, the options [-014578] can be used to select one of the compiled-in backup devices, /dev/rstN. Lowkey handy if you're on that retro tape vibe. πΌ
π ENVIRONMENT π
TMPDIRβ Path in which to store temporary files. Your temp zone, your rules. ποΈTAPEβ Default tape device to use instead of/dev/rst0. If set to hyphen (-), standard output is used. So-means spill the tea to stdout. β
π FILES π
/dev/rst0β default archive name. The O.G. spot. πΎ
β¨ EXIT STATUS β¨
The paxtar utility exits with one of the following values:
0β All files were processed successfully. Slay! π1β An error occurred. Oop. π
π¦ EXAMPLES π¦
Create an archive on the default tape drive, containing the files named bonvole and sekve:
$ paxtar c bonvole sekve
Output a gzip(1) compressed archive containing the files bonvole and sekve to a file called foriru.tar.gz:
$ paxtar zcf foriru.tar.gz bonvole sekve
Verbosely create an archive, called backup.tar.gz, of all files matching the shell glob(7) function *.c:
$ paxtar zcvf backup.tar.gz *.c
Verbosely list, but do not extract, all files ending in .jpeg from a compressed archive named backup.tar.gz. Note that the glob pattern has been quoted to avoid expansion by the shell:
$ paxtar tvzf backup.tar.gz '*.jpeg'
For more detailed examples, see pax(1). π
π DIAGNOSTICS π
Whenever paxtar cannot create a file or a link when extracting an archive, or cannot find a file while writing an archive, or cannot preserve the user ID, group ID, file mode, or access and modification times when the -p option is specified, a diagnostic message is written to standard error and a non-zero exit value will be returned, but processing will continue. In the case where paxtar cannot create a link to a file, unless -M lncp is given, paxtar will not create a second copy of the file. No cap. π¨
If the extraction of a file from an archive is prematurely terminated by a signal or error, paxtar may have only partially extracted the file the user wanted. Additionally, the file modes of extracted files and directories may have incorrect file bits, and the modification and access times may be wrong. Messy. π¬
If the creation of an archive is prematurely terminated by a signal or error, paxtar may have only partially created the archive, which may violate the specific archive format specification. Yikes. β οΈ
πΈ SEE ALSO πΈ
ar(1), cpio(1), pax(1), paxcpio(1), tar(1), deb(5)
π HISTORY π
A tar command first appeared in Version 7 AT&T UNIX. The ancestor. π
π AUTHORS π
Keith Muller at the University of California, San Diego. MirBSD extensions by mirabilos <m@mirbsd.org>. Legends. π«Ά
β οΈ CAVEATS β οΈ
The flags -aDJjLMo are not portable to other implementations of tar where they may have a different meaning or not exist at all. So don't assume, bestie. π
ββοΈ
This implementation may have support for other non-standard options that are undocumented because removal-inducing deprecation was issued. Spooky. π»
π BUGS π
The pax file format is not yet supported. It's giving not-yet. π
From MirBSD, dated January 5, 2024 β PAXTAR(1), periodt. π
π¦ where this page comes from
- alpine 3.24: pax-doc 20240817-r1 Β· BSD-3-Clause
- arch rolling: pax 20240817-1 Β· BSD-3-Clause
- debian trixie: pax 1:20240817-1
- nixos 26.05: pax 20240817
- nixpkgs unstable: pax 20240817
- ubuntu questing: pax 1:20240817-1
- ubuntu resolute: pax 1:20240817-1build1
- ubuntu stonking: pax 1:20240817-1build1
- Copyright Β© 2005, 2008, 2009, 2011, 2012, 2014, 2016 2017, 2018, 2019, 2020, 2021
- Copyright (c) 1996 SigmaSoft, Th. Lockert
- Copyright Β© 2008, 2009, 2010, 2016, 2018, 2020, 2023 mirabilos <m@mirbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms