pax is an archiving utility available for various operating systems and defined since 1995. Rather than sort out the incompatible options that have crept up between <code>tar</code> and <code>cpio</code>, along with their implementations across various versions of Unix, the IEEE designed a new archive utility, pax, that could support various archive formats with useful options from both archivers. The <code>pax</code> command is available on Unix and Unix-like operating systems and on IBM i, and Microsoft Windows NT The format is not supported by pax commands in most Linux distributions and in FreeBSD, but it is supported by tar commands from GNU and FreeBSD; the format is further supported by pax commands in OpenBSD, AIX, Solaris and HP-UX.
The name "pax" is an acronym for portable archive exchange, but is also an allusion to the Latin word for "peace"; the command invocation and structure represents somewhat of a peaceful unification of both <code>tar</code> and <code>cpio</code>.
History
The first public implementation of pax was written by Mark H. Colburn in 1989. Colburn posted it to as Usenix/IEEE POSIX replacement for TAR and CPIO. Manual pages for pax on HP-UX, IRIX, and SCO UNIX attribute pax to Colburn.
As early as POSIX.2 draft 10 from July 1990 covers pax command. Furthermore, POSIX.2 and IEEE 1003.1b drafts in 1991 cover pax command, featuring cpio and ustar archive formats.
Another version of the pax program was created by Keith Muller in 1992–1993. The version first appeared in 4.4BSD (1995). and on FreeBSD. The format is supported by pax command in AIX, Solaris and HP-UX. It is further supported by Python tarfile module, by BSD-licensed libarchive, by 7-ZIP and further by GNU tar and FreeBSD tar. The Heirloom Project pax command, developed by Gunnar Ritter in 2003, supports the pax format as well as many extra formats.
Multiple volumes
pax supports archiving on multiple volumes. When the end of a volume is reached, the following message appears:
<syntaxhighlight lang="console">
$ pax -wf /dev/fd0 .
ATTENTION! pax archive volume change required.
/dev/fd0 ready for archive volume: 2
Load the NEXT STORAGE MEDIA (if required) and make sure it is WRITE ENABLED.
Type "y" to continue, "." to quit pax, or "s" to switch to new device.
If you cannot change storage media, type "s"
Is the device ready and online? >
</syntaxhighlight>
When restoring an archive from multiple media, pax asks for the next media in the same fashion, when the end of the media is reached before the end of the archive.
Standardization, reception and popularity
Despite being standardized in 2001 by IEEE, as of 2010, pax enjoys relatively little popularity or adoption. This is in part because there was not any need for it from the Unix users; it was just the POSIX committee that wants to have a more consistent interface. Pax is also fairly chatty and expects user interactions when things go wrong.
pax is required to be present in all conformant systems by Linux Standard Base since version 3.0 (released on July 6, 2005), but so far few Linux distributions ship and install it by default. However, most distributions include pax as a separately installable package.
pax has also been present in Windows NT, where it is limited to file archives (tapes not supported). It was later moved to the Interix subsystem. It does not support archiving or restoring Win32 ACLs. pax was further present in Windows 2000.
Packages handled by the Installer (macOS) often carry the bulk of their contents in an Archive.pax.gz file that may be read using the system's pax (heirloom) utility.
See also
- List of Unix commands
- List of archive formats
- Comparison of file archivers
References
Further reading
External links
- Archiving with Pax Article in FreeBSD basics on ONLamp.com , by Dru Lavigne (2002-08-22)
- pax.1p – Linux Manual – POSIX Programmer's Manual, not actual Linux
- Source code
