Share to: share facebook share twitter share wa share telegram print page

Pax (command)

pax
Original author(s)Mark H. Colburn (sponsored by The USENIX Association)
Developer(s)Various open-source and commercial developers
Initial release1989; 35 years ago (1989)
Written inColburn pax, Muller pax, Heirloom Project pax: C
Operating systemUnix, Unix-like, IBM i, Windows
PlatformCross-platform
TypeCommand
LicenseColburn pax: Prior BSD License
Muller pax: BSD-4-Clause
Heirloom Project pax: zlib
Windows: Proprietary software

pax is an archiving utility available for various operating systems and defined since 1995.[1] Rather than sort out the incompatible options that have crept up between tar and cpio, 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 pax command is available on Unix and Unix-like operating systems and on IBM i,[2] and Microsoft Windows NT[3] until Windows 2000.

In 2001, IEEE defined a new pax format which is basically tar with additional extended attributes.[4][5] 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 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 tar and cpio.

History

The first public implementation of pax was written by Mark H. Colburn in 1989. Colburn posted it to comp.sources.unix as Usenix/IEEE POSIX replacement for TAR and CPIO. Manual pages for pax on HP-UX, IRIX, and SCO UNIX attribute pax to Colburn.[6]

As early as POSIX.2 draft 10 from July 1990 covers pax command.[7] 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.[8] The version first appeared in 4.4BSD (1995).[9] Pax command appeared in X/Open issue 4 (Single Unix Specification version 1) in 1995,[1] featuring cpio and ustar archive formats, which were also the only two formats featuring in the 1997 Single Unix Specification.

In 1997, Sun Microsystems 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 pax utility was updated to include this format.[1]

Features

Modes

pax has four general modes that are invoked by a combination of the -r ("read") and -w ("write") options.

This table summarizes the modal behaviour:

Option Mode Description
(none) "list" shows contents of archive, does not modify or extract anything.
-r "read" reads and extracts contents of an archive
-w "write" creates archives or appends files to an archive
-rw "copy" reads and copies files and directory tree to a specified directory

This model is similar to cpio, which has a similar set of basic operations.

Examples

List contents of an archive:

$ pax < archive.tar

Extract contents of an archive into the current directory:

$ pax -r < archive.tar

Create an archive of the current directory:

$ printf '.' | pax -w > archive.tar
$ pax -w . > archive.tar

Copy current directory tree to another location:

$ printf '.' | pax -w > archive.tar
$ pax -rw target_dir .

(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 -f 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 -d to disable it.

The pax command is a mish-mash of cpio and tar features. Like tar, pax processes directory entries recursively, a feature that can be disabled with -d 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 pax takes the cpio-style behavior of using the standard input for a file list. Finally, pax supports reading/writing to a named archive file using tar's -f FILE option.

For example, if one desires a cpio-style archiving of the current directory, pax can be used with find just like one does using cpio:

$ find . -depth -print | pax -wd > archive.tar

(This construct is pointless without any filters for find, as it becomes identical to the above example.)

The command for extracting the contents for an archive is the same as cpio:

$ pax -r < archive.tar

It is possible to invoke these commands in a tar-like syntax as well:

$ pax -wf archive.tar . # write (archive)
$ pax -rf archive.tar   # read (extract)
$ pax -f archive.tar    # list
$ pax -rw . archive_dir # copy

Compression

Most implementations of pax use the -z (gzip) and -j (bzip2) 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:

$ pax -rzf archive.tar.gz

As in tar and cpio, pax output can be piped to another compressor/decompressor program. As an example xz is used here:

$ pax -w . | xz > archive.tar.xz

and listing an xz-compressed archive as the input:

$ xzcat archive.tar.xz | pax

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 -x option:

  • cpio – 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 – The old BSD tar format as found in BSD4.3.
  • ustar (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)[10][11][12] and on FreeBSD.[9] The format is supported by pax command in AIX,[13] Solaris[14] and HP-UX. It is further supported by Python tarfile module,[15] by BSD-licensed libarchive,[16][17] by 7-ZIP[18] and further by GNU tar[19] and FreeBSD tar.[20] The Heirloom Project pax command, developed by Gunnar Ritter in 2003, supports the pax format as well as many extra formats.[21]

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.[citation needed] 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.[citation needed]

pax is required to be present in all conformant systems by Linux Standard Base since version 3.0 (released on July 6, 2005),[22] but so far few Linux distributions ship and install it by default. However, most distributions include pax as a separately installable package.[23][24][25]

pax has also been present in Windows NT, where it is limited to file archives (tapes not supported).[3] It was later moved to the Interix subsystem. It does not support archiving or restoring Win32 ACLs.[26] pax was further present in Windows 2000.[27]

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.[28]

See also

References

  1. ^ a b c The Open Group Base Specifications Issue 6 - POSIX.1-2001 (IEEE Std 1003.1) Copyright © 2001-2004 The IEEE and The Open Group
  2. ^ IBM. "IBM System i Version 7.2 Programming Qshell" (PDF). IBM. Retrieved 2020-09-05.
  3. ^ a b Eric Pearce (1997). Windows NT in a nutshell: a desktop quick reference for system administrators. O'Reilly Media, Inc. p. 271. ISBN 978-1-56592-251-8.
  4. ^ "GNU tar: 8.1 Using Less Space through Compression". www.gnu.org. Archived from the original on 6 March 2016. Retrieved 22 April 2018.
  5. ^ "GNU tar: 4.3.2 Extended File Attributes". www.gnu.org. Archived from the original on 28 December 2019. Retrieved 27 January 2021.
  6. ^ TAR versus Portability – PAX and USTAR, invisible-island.net
  7. ^ IEEE P1003.2 Draft 11.2−September 1991 (pdf) - Shell and Utilities, princeton.edu - Draft 11 indicates changes to pax so it must have been in draft 10
  8. ^ pax, svnweb.freebsd.org
  9. ^ a b pax(1) – FreeBSD General Commands Manual
  10. ^ "MirCPIO — paxmirabilis: tar and even ar!". MirBSD. Retrieved 24 January 2020.
  11. ^ "MirCPIO in Launchpad". launchpad.net. Retrieved 22 April 2018.
  12. ^ "Bug #456405 "pax lack of support for "pax" format fails LSB" : Bugs : MirCPIO". bugs.launchpad.net. Retrieved 22 April 2018.
  13. ^ pax for AIX 7.3, ibm.com
  14. ^ pax for Solaris 11.1, docs.oracle.com
  15. ^ tarfile, python.org
  16. ^ libarchive, libarchive.org
  17. ^ libarchive(3), freebsd.org
  18. ^ HISTORY of the 7-Zip, 7-zip.org
  19. ^ tar manual, gnu.org
  20. ^ tar, freebsd.org
  21. ^ "pax.1". heirloom.sourceforge.net. Retrieved 22 April 2018.
  22. ^ Release notes for LSB 3.0 Archived 2011-07-17 at the Wayback Machine note that pax was added: LSB 3.0. Commands and Utilities requires pax, but LSB 2.1.0. Commands and Utilities does not require it
  23. ^ pax, pkgs.org
  24. ^ spax, pkgs.org
  25. ^ heirloom-pax, pkgs.org
  26. ^ "System Administration of Backups, Tar, and Pax in Interix". Archived from the original on 2010-08-23.
  27. ^ Virtual x86, copy.sh
  28. ^ "Extracting files from a pax.gz package". cocoabuilder.com. Archived from the original on 14 February 2015. Retrieved 15 August 2013.

Further reading

Read other articles:

Comune in Trentino-Alto Adige/Südtirol, ItalySirorComuneComune di SirorLocation of Siror SirorLocation of Siror in ItalyShow map of ItalySirorSiror (Trentino-Alto Adige/Südtirol)Show map of Trentino-Alto Adige/SüdtirolCoordinates: 46°11′N 11°50′E / 46.183°N 11.833°E / 46.183; 11.833CountryItalyRegionTrentino-Alto Adige/SüdtirolProvinceTrentino (TN)FrazioniNolesca, part of San Martino di CastrozzaArea • Total75.1 km2 (29.0 sq m...

Tòa thị chính ở SandomierzRatusz w SandomierzuThông tin chungTọa độ50°40′45.9″N 21°44′57.7″ETòa thị chính ở Sandomierz (tiếng Ba Lan: Ratusz w Sandomierzu) là một tòa nhà lịch sử đã được ghi danh vào Sổ đăng ký các di tích bất động trong tỉnh Świętokrzyskie của Viện Di sản Quốc gia Ba Lan.[1] Hiện tại, tòa thị chính là trụ sở của một chi nhánh của Bảo tàng Quận, Văn phòng Đăng ký và c...

Primula acaulis Classificação científica Reino: Plantae Clado: angiospérmicas Clado: eudicotiledóneas Ordem: Primulales Família: Primulaceae Género: Primula Espécie: P. acaulis Nome binomial Primula acaulis(L.) L. Primula acaulis é uma espécie de planta com flor pertencente à família Primulaceae, vulgarmente chamada pão-de-leite,[1] pão-e-queijo,[2] primavera,[3] prímula,[4] quejadilho[5] ou rosa-de-páscoa.[6] A autoridade científica da espécie é (L.) L., tendo sido publica...

У Вікіпедії є статті про інші значення цього терміна: Флінт (значення). Місто Флінтвалл. Y Fflint Картина Замок Флінт роботи Вільяма Тернера Координати 53°14′38″ пн. ш. 3°07′55″ зх. д.H G O Країна Велика БританіяВелика БританіяРегіон УельсГрафство ФлінтширМежує з сусід

Teluk Bone adalah sebuah teluk yang berada di Kabupaten Bone, Sulawesi Tenggara. Teluk Bone merupakan bagian dari perairan Kepulauan Hindia Timur. Potensi yang dimiliki Teluk Bone belum dikelola dengan maksimal, kecuali sebagai pelabuhan perikanan dan pelabuhan penyeberangan. Geografi Teluk ini adalah enklaf selatan di Sulawesi dan berbatasan dengan: Utara: Pulau Sulawesi Bahagian Tengah Timur: Semenanjung Tenggara Sulawesi Selatan: Laut Flores Barat: Semenanjung Selatan Sulawesi Definisi men...

A Gudiña Gemeente in Spanje Situering Autonome regio Galicië Provincie Comarca Ourense Viana Coördinaten 42° 3′ NB, 7° 8′ WL Algemeen Oppervlakte 171 km² Inwoners (1 januari 2016) 1.345 (8 inw./km²) Provincie- engemeentecode 32.034 Portaal    Spanje De kerk van A Gudiña in 2007 A Gudiña is een gemeente in de Spaanse provincie Ourense in de regio Galicië met een oppervlakte van 171 km². A Gudiña telt 1.345 inwoners (1 januari 2016). Mediabestanden Mediabe...

Cet article possède un paronyme, voir Université ouverte. Université ouverteHistoireFondation 1969StatutType Université publique de formation à distance, université ouverteNom officiel The Open UniversityRégime linguistique AnglaisFondateur Harold WilsonDevise « Learn and Live » « Apprendre et vivre »Membre de EADTU, MSACSSite web www.open.ac.ukChiffres-clésÉtudiants Environ 180 000LocalisationPays Royaume-UniVille Milton Keynes (siège)Localisation sur l...

Евангелическая лютеранская церковь в Америке Общие сведения Основание 1 января 1988 Конфессия лютеранство Соглашения Всемирный совет церквей, ВЛФ, Christian Churches Together[d], Churches Uniting in Christ[d] и Национальный совет церквей Руководство Предстоятель Элизабет Итон Центр Luthera...

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: List of TGV stations – news · newspapers · books · scholar · JSTOR (January 2021) (Learn how and when to remove this template message) These are all the TGV (French: train à grande vitesse, meaning high-speed train) stations, listed alphabetically. This list i...

Por favor, melhore este artigo ou secção, expandindo-o. Mais informações podem ser encontradas nos artigos correspondentes noutras línguas e também na página de discussão. (Abril de 2014) Boudhanath बौद्धनाथ • Bauddha BoudhanathVista da estupa de Boudhanath Nomes alternativos Baudhanath • Bodnath • Boudha • Khāsti Tipo estupa budista Início da construção século V, VI ou XIV (?) Religião Budismo tibetano Dimensões Altura 36 Diâmetro 120 Área 11 300...

MotoNauyanam Avasyabhavi Jivanam AnavasyabhaviMoto dalam bahasa IndonesiaDi darat kita berkarya,Di laut kita berjayaDidirikan1957AfiliasiKementerian Perhubungan IndonesiaKetuaAmiruddin, MM, .Nama julukanSTIP Jakarta STIP Jakarta adalah salah satu perguruan tinggi kedinasan di Indonesia di bawah naungan Kementerian Perhubungan Republik Indonesia yang berdiri sejak tahun 1953 dan dahulu dikenal dengan nama Akademi Ilmu Pelayaran (AIP) atau Pendidikan dan Latihan Ahli Pelayaran (PLAP) Jakar...

Attraction at Disney theme parks Davy Crockett Explorer CanoesDisneylandAreaCritter CountryStatusOperatingOpening dateJuly 4, 1956 Magic KingdomAreaFrontierlandStatusRemovedOpening dateOctober 1, 1971Closing date1994 Tokyo DisneylandNameBeaver Brothers Explorer CanoesAreaCritter CountryStatusOperatingOpening dateApril 15, 1983 Disneyland Park (Paris)AreaFrontierlandStatusRemovedOpening dateApril 12, 1992Closing date1994 Shanghai DisneylandNameExplorer Canoes[1]探险家独木舟AreaTr...

Canadian baseball player (1932-2000) Baseball player Georges MarandaPitcherBorn: (1932-01-15)January 15, 1932Lévis, QuébecDied: July 14, 2000(2000-07-14) (aged 68)LévisBatted: RightThrew: RightMLB debutApril 26, 1960, for the San Francisco GiantsLast MLB appearanceSeptember 10, 1962, for the Minnesota TwinsMLB statisticsWin–loss record2–7Earned run average4.52Strikeouts64Innings pitched1231⁄3 Teams San Francisco Giants (1960) Minnesota Twins (19...

  此條目介紹的是改編自東野圭吾小說的電視劇。关于原作的短篇推理小說,请见「偵探伽利略」。 本頁面使用HTML注音,若瀏覽器不支持,注音會顯示在文字後方,如:衣(yī)。 神探伽利略ガリレオ类型偵探、推理、懸疑原作東野圭吾「伽利略系列」(文春文庫刊)编剧第一季 福田靖古家和尚松本歐太郎第二季福田靖仁志光佑伽利略Φ福田靖伽利略XX池上純哉伽利...

1983 video game 1983 video gameBristlesDeveloper(s)First Star SoftwarePublisher(s)First Star SoftwareStatesoft (Spectrum)[1]Designer(s)Fernando HerreraProgrammer(s)Atari 8-bitFernando HerreraRobert Diaz[2]Commodore 64Adam Bellin[3]ZX SpectrumRichard Huddy[1]Composer(s)Jerry White[2]Platform(s)Atari 8-bit, Commodore 64, Arcade, ZX SpectrumRelease1983: Atari, C641984: Arcade, SpectrumGenre(s)PlatformMode(s)Single-player2-4 player multiplayer Bristles is a...

Record label in Nigeria Jonzing WorldParent companyMavin Global HoldingsFounded22 March 2019; 4 years ago (2019-03-22)FounderD'PrinceStatusActiveDistributor(s)Sony Music EntertainmentGenreVariousCountry of originNigeriaLocationLagosSloganJonzing Jonzing World is a Nigerian record label and management company which was founded by a recording artist D'Prince on 22 March 2019.[1] Jonzing services includes, music recording, merchandising, audiovisual content, branding, a...

Konsonan sembur tarik-belakang hentiʈʼPengkodean karakterX-SAMPAt`_> Gambar Sampel suaranoicon sumber · bantuan Konsonan sembur tarik-belakang hentian merupakan suara konsonantal yang digunakan dalam beberapa bahasa lisan. Konsonan ini dilambangkan dalam Alfabet Fonetik Internasional sebagai ⟨ʈʼ⟩ yang merupakan letupan tarik-belakang nirsuara /ʈ/ dengan diakritik sembur ⟨ʼ⟩. Karakteristik konsonan Karakteristik konsonan dari konsonan sembur t...

Diagram ikatan fosfodiester (PO43−) antara tiga nukleotida. Ikatan fosfodiester terjadi ketika tepatnya dua gugus hidroksil dalam asam fosfat bereaksi dengan gugus hidroksil pada molekul lain untuk membentuk dua ikatan ester.[1] Ikatan fosfodiester adalah pusat dari semua kehidupan di Bumi karena mereka membentuk tulang punggung untaian asam nukleat. Dalam DNA dan RNA, ikatan fosfodiester adalah hubungan antara atom karbon pada posisi 3' dari satu molekul gula dan atom karbon pada p...

German footballer Christopher Bieber Bieber in 2014Personal informationDate of birth (1989-07-03) 3 July 1989 (age 34)Place of birth Bad Mergentheim, West GermanyHeight 1.96 m (6 ft 5 in)[1]Position(s) ForwardTeam informationCurrent team TSV AubstadtNumber 37Youth career2006–2007 Karlsruher SCSenior career*Years Team Apps (Gls)2007–2010 Karlsruher SC II 54 (4)2009–2011 Karlsruher SC 2 (0)2011–2012 FC Oss 28 (10)2012–2016 Würzburger Kickers 119 (50)2016...

2023 soundtrack album by Brian TylerThe Super Mario Bros. Movie (Original Motion Picture Soundtrack)Soundtrack album by Brian TylerReleasedApril 7, 2023RecordedOctober–December 2022StudioEastwood Scoring Stage, Warner Bros. StudiosSkywalker SoundGenreFilm soundtrackLength87:46LabelBack Lot MusicProducerBrian TylerBrian Tyler chronology Scream VI(2023) The Super Mario Bros. Movie(2023) Fast X(2023) Singles from The Super Mario Bros. Movie (Original Motion Picture Soundtrack) PeachesR...

Kembali kehalaman sebelumnya