pax (Unix)

Pax is a command on Unix operating systems for file archiving, which is standardized by POSIX. The command itself as the successor of tar and cpio and works with a large number of different tar and cpio archive data formats, hence the name pax stands for portable archive exchange, but also based on the Latin word for " peace ", because the program is to create peace between the two rival commands tar and cpio. pax used by default which is also defined in POSIX ustar file format, the command structure is similar to but more cpio.

The program is described by POSIX.1 -2001 or The Open Group Base Specifications Issue 6 IEEE Std 1003.1, 2004 Edition.

Operation and Example Views

Pax has four basic functions, which of the options -w ( " Write mode ", creating an archive ), -r ( "Read " mode, extracting from an archive ) and-r -w ( " Copy mode ", Copy specified by directory trees ). If no option is specified, the pax " List mode " and shows the archive content. pax basically works like other Unix - filter, ie, it expects its arguments from the input data stream and sends its results to the output data stream.

Unpack the archive file in the current directory test.pax:

Pax -r < test.pax or

Pax -r -f test.pax Create an archive file to the directory / tmp.:

. find / tmp -depth -print | pax -wd -f test.pax or

. find / tmp -depth -print | pax -wd > test.pax Show the files and directories contained in an archive file:

Pax -f test.pax Copy the files and directories in the current directory to the directory / path / directory:

Place. -depth -print | pax -r -w / path / directory In this case, the use of depth - on the one hand cause that the time stamps of directories are also adopted for poor quality of pax implementation, but it carries the other hand the risk that files can not be copied in read-only directories.

639262
de