HOME

TheInfoList



OR:

pax is an archiving utility available for various
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s and defined since 1995.The Open Group Base Specifications Issue 6
- POSIX.1-2001 ''(IEEE Std 1003.1)'' Copyright © 2001-2004 The IEEE an
The Open Group
/ref> Rather than sort out the incompatible options that have crept up between
tar Tar is a dark brown or black viscous liquid of hydrocarbons and free carbon, obtained from a wide variety of organic materials through destructive distillation. Tar can be produced from coal, wood, petroleum, or peat. "a dark brown or black b ...
and
cpio cpio is a general file archiver utility and its associated file format. It is primarily installed on Unix-like computer operating systems. The software utility was originally intended as a tape archiving program as part of the Programmer's Work ...
, along with their implementations across various versions of
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
, the
IEEE The Institute of Electrical and Electronics Engineers (IEEE) is an American 501(c)(3) organization, 501(c)(3) public charity professional organization for electrical engineering, electronics engineering, and other related disciplines. The IEEE ...
designed a new archive utility, pax, that could support various archive formats with useful options from both archivers. The pax
command Command may refer to: Computing * Command (computing), a statement in a computer language * command (Unix), a Unix command * COMMAND.COM, the default operating system shell and command-line interpreter for DOS * Command key, a modifier key on A ...
is available on Unix and
Unix-like A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
s and on
IBM i IBM i (the ''i'' standing for ''integrated'') is an operating system developed by IBM for IBM Power Systems. It was originally released in 1988 as OS/400, as the sole operating system of the IBM AS/400 line of systems. It was renamed to i5/OS in 2 ...
, and
Microsoft Microsoft Corporation is an American multinational corporation and technology company, technology conglomerate headquartered in Redmond, Washington. Founded in 1975, the company became influential in the History of personal computers#The ear ...
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
until
Windows 2000 Windows 2000 is a major release of the Windows NT operating system developed by Microsoft, targeting the server and business markets. It is the direct successor to Windows NT 4.0, and was Software release life cycle#Release to manufacturing (RT ...
. In 2001, IEEE defined a new ''pax'' format which is basically ''tar'' with additional extended attributes. The format is not supported by pax commands in most Linux distributions and in FreeBSD, but it is supported by
tar Tar is a dark brown or black viscous liquid of hydrocarbons and free carbon, obtained from a wide variety of organic materials through destructive distillation. Tar can be produced from coal, wood, petroleum, or peat. "a dark brown or black b ...
commands from GNU and FreeBSD; the format is further supported by pax commands in AIX, Solaris and HP-UX. The name "pax" is an acronym for ''portable archive exchange'', but is also an allusion to the
Latin Latin ( or ) is a classical language belonging to the Italic languages, Italic branch of the Indo-European languages. Latin was originally spoken by the Latins (Italic tribe), Latins in Latium (now known as Lazio), the lower Tiber area aroun ...
word for "peace"; the command invocation and structure represents somewhat of a peaceful unification of both tar and cpio.


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 HP-UX (from "Hewlett Packard Unix") is a proprietary software, proprietary implementation of the Unix operating system developed by Hewlett Packard Enterprise; current versions support HPE Integrity Servers, based on Intel's Itanium architect ...
,
IRIX IRIX (, ) is a discontinued operating system developed by Silicon Graphics (SGI) to run on the company's proprietary MIPS architecture, MIPS workstations and servers. It is based on UNIX System V with Berkeley Software Distribution, BSD extensio ...
, and
SCO UNIX Xinuos OpenServer, previously SCO UNIX and SCO Open Desktop (SCO ODT), is a closed source computer operating system developed by Santa Cruz Operation (SCO), later acquired by SCO Group, and now owned by Xinuos. Early versions of OpenServer were ...
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 The history of the Berkeley Software Distribution began in the 1970s when University of California, Berkeley received a copy of Research Unix, Unix. Professors and students at the university began adding software to the operating system and releas ...
(1995). Pax command appeared in
X/Open X/Open group (also known as the Open Group for Unix Systems and incorporated in 1987 as X/Open Company, Ltd.) was a consortium founded by several European UNIX systems manufacturers in 1984 to identify and promote open standards in the field of info ...
issue 4 (
Single Unix Specification The Single UNIX Specification (SUS) is a standard for computer operating systems, compliance with which is required to qualify for using the "UNIX" trademark. The standard specifies programming interfaces for the C language, a command-line shell, ...
version 1) in 1995, featuring cpio and ustar archive formats, which were also the only two formats featuring in the 1997 Single Unix Specification. In 1997,
Sun Microsystems Sun Microsystems, Inc., often known as Sun for short, was an American technology company that existed from 1982 to 2010 which developed and sold computers, computer components, software, and information technology services. Sun contributed sig ...
proposed a method for adding extensions to the ustar format. This method was accepted for the POSIX.1-2001 standard as the new ''pax'' file format. The POSIX specification for the utility was updated to include this format.


Features


Modes

pax has four general modes that are invoked by a combination of the ("read") and ("write") options. This table summarizes the modal behaviour: This model is similar to cpio, which has a similar set of basic operations.


Examples

List contents of an archive: Extract contents of an archive into the current directory: Create an archive of the current directory: Copy current directory tree to another location: (The target directory must exist beforehand!)


Command invocation

By default, pax uses the standard input/output for archive and listing operations. This can be changed with the "tar-style" option that specifies the archive file. Pax differs from cpio by recursively considering the content of a directory; to disable this behavior, POSIX pax has an option to disable it. The command is a mish-mash of and features. Like , processes directory entries recursively, a feature that can be disabled with for cpio-style behavior. The handling of file input/outputs is also a mix: when a list of file names is specified on the command line, they are taken as shell globs for file input or listing (tar-like); otherwise takes the -style behavior of using the standard input for a file list. Finally, supports reading/writing to a named archive file using tar's option. For example, if one desires a cpio-style archiving of the current directory, can be used with just like one does using cpio: (This construct is pointless without any filters for , as it becomes identical to the above example.) The command for extracting the contents for an archive is the same as : It is possible to invoke these commands in a tar-like syntax as well:


Compression

Most implementations of pax use the (
gzip gzip is a file format and a software application used for file compression and decompression. The program was created by Jean-loup Gailly and Mark Adler as a free software replacement for the compress program used in early Unix systems, and ...
) and (
bzip2 bzip2 is a free and open-source file compression program that uses the Burrows–Wheeler algorithm. It only compresses single files and is not a file archiver. It relies on separate external utilities such as tar for tasks such as handli ...
) switches for compression; this feature however, is not specified by POSIX. It is important to note that pax cannot append to compressed archives.
Example for extracting a gzipped archive: As in tar and cpio, pax output can be piped to another compressor/decompressor program. As an example xz is used here: and listing an xz-compressed archive as the input:


Format support

POSIX.1-2001 requires that ''pax'' command supports the archive formats cpio, ustar and pax at a minimum. The versions of ''pax'' command that stem from the 4.4BSD implementation usually inherit the formats supported by that version, selectable via the option: *
cpio cpio is a general file archiver utility and its associated file format. It is primarily installed on Unix-like computer operating systems. The software utility was originally intended as a tape archiving program as part of the Programmer's Work ...
– The extended cpio interchange format specified in the IEEE Std 1003.2 ("POSIX.2") standard. * bcpio – The old binary cpio format. * sv4cpio – The System V release 4 cpio. * sv4crc – The System V release 4 cpio with file crc checksums. *
tar Tar is a dark brown or black viscous liquid of hydrocarbons and free carbon, obtained from a wide variety of organic materials through destructive distillation. Tar can be produced from coal, wood, petroleum, or peat. "a dark brown or black b ...
– The old BSD tar format as found in BSD4.3. *
ustar The Utah Science Technology and Research Initiative (USTAR) is a technology-based economic development agency funded by the state of Utah. The organization works to develop ideas and research into marketable products and successful companies throu ...
''(default)'' – The tar interchange format specified in the IEEE Std 1003.2 ("POSIX.2") standard. The POSIX.1-2001 ''pax'' format is not supported by this BSD version of ''pax'' command. The format is not supported on most Linux distributions (whose ''pax'' command is from the MirBSD branch of ''MirCPIO-paxmirabilis'') and on
FreeBSD FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
. 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 The Heirloom Project is a collection of traditional Unix utilities. Most of them are derived from original Unix source code, as released as open-source by Caldera and Sun. The project has the following components: * The Heirloom Toolchest: awk, ...
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: $ 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? > 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 The Linux Standard Base (LSB) was a joint project by several Linux distributions under the organizational structure of the Linux Foundation to standardize the software system structure, including the Filesystem Hierarchy Standard. LSB was based ...
since version 3.0 (released on July 6, 2005), but so far few
Linux distribution A Linux distribution, often abbreviated as distro, is an operating system that includes the Linux kernel for its kernel functionality. Although the name does not imply product distribution per se, a distro—if distributed on its own—is oft ...
s ship and install it by default. However, most distributions include pax as a separately installable package. pax has also been present in
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
, where it is limited to file archives (tapes not supported). It was later moved to the
Interix Interix was an optional, POSIX-conformant Unix subsystem for Windows NT operating systems. Interix was a component of Windows Services for UNIX, and a superset of the Microsoft POSIX subsystem. Like the POSIX subsystem, Interix was an environme ...
subsystem. It does not support archiving or restoring
Win32 The Windows API, informally WinAPI, is the foundational application programming interface (API) that allows a computer program to access the features of the Microsoft Windows operating system in which the program is running. Programs can acces ...
ACLs. pax was further present in Windows 2000. Packages handled by the
Installer (macOS) This is a list of built-in apps and system components developed by Apple Inc. for macOS that come bundled by default or are installed through a system update. Many of the default programs found on macOS have counterparts on Apple's other operat ...
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 This is a list of the shell commands of the most recent version of the Portable Operating System Interface (POSIX) IEEE Std 1003.1-2024 which is part of the Single UNIX Specification (SUS). These commands are implemented in many shells on moder ...
*
List of archive formats This is a list of file formats used by file archiver, archivers and data compression, compressors used to create Archive file, archive files. Archive formats by purpose Archive formats are used for backups, mobility, and archiving. Many archive ...
*
Comparison of file archivers The following tables compare general and technical information for a number of file archivers. Please see the individual products' articles for further information. They are neither all-inclusive nor are some entries necessarily up to date. Unless ...


References


Further reading

*


External links


Archiving with Pax
Article in ''FreeBSD basics'' o
ONLamp.com
, b
Dru Lavigne
''(2002-08-22)'' * * *

– Linux Manual – POSIX Programmer's Manual, not actual Linux * *
Source code
{{Archive formats File archivers Unix archivers and compression-related utilities Unix SUS2008 utilities IBM i Qshell commands 1995 software