LinuxCommandLibrary

paxs

Extract and create archive files

TLDR

Search for a package

$ paxs [search_term]
copy

Upgrade all packages
$ paxs [[-u|--upgrade-all]]
copy

Install a package (prompting for the source)
$ paxs [[-i|--install]] [package]
copy

Remove a package (prompting for the source)
$ paxs [[-r|--remove]] [package]
copy

Check for updates across all package managers
$ paxs [[-c|--check-update]]
copy

Display help
$ paxs [[-h|--help]]
copy

SYNOPSIS

pax [-cdHilnOTvwx] [-f archive] [-s replacement]... [-o options]... [pattern...]
pax -r [-cdHilnOTvw] [-f archive] [-s replacement]... [-o options]... [pattern...]
pax -w [-dHilnOTvw] [-f archive] [-s replacement]... [-o options]... [file...]
pax -r -w [-dHilnOTvw] [-s replacement]... [-o options]... [file...] directory

PARAMETERS

-c
    Invert the sense of the pattern arguments. pax will select all files except those matching the pattern arguments.

-d
    Cause files with symbolic links to be archived as normal files. The archive is created with the link itself; the contents of the linked-to file are not archived.

-f archive
    Specify the archive file to be used. If not specified, pax will use standard input (for reading) or standard output (for writing).

-H
    Follow symbolic links only during traversal of the command line arguments. If a command line argument is a symbolic link, it will be followed. Symbolic links encountered during the traversal of directory hierarchies will not be followed.

-i
    Interactively rename files. For each file, pax will print the file name and prompt for a new name. An empty reply retains the original name. This is useful for changing file names during extraction or copying.

-l
    On write options, the option ensures the creation of hard links between file copies, rather than creating duplicate file copies. On read options, it resolves hard links when extracting files from an archive.

-n
    Select the first file matching each pattern. This stops the archive operation after the first match is found for each pattern, useful for extracting specific files from large archives.

-O options
    Apply specific format options when creating an archive.

-r
    Read the archive.

-s replacement
    Modify file or member names using the replacement string, which is in the form 's/old/new/[gp]'. This allows for substituting parts of file names during extraction or creation of archives.

-T
    Preserve access times. During extraction, this ensures that the access times of files are restored to their original values.

-v
    Verbose output. It displays the name of each file being processed.

-w
    Write an archive.

-x format
    Specify the archive format. Common formats include tar, cpio, and ustar.

DESCRIPTION

pax is a portable archive interchange utility that can create, read, and write archive files. It supports multiple archive formats, including tar, cpio, and shar, making it a versatile tool for archiving and transferring files across different systems. It is designed to be POSIX compliant and aims to provide a consistent interface for archive operations regardless of the underlying format. pax can handle various aspects of archive manipulation, such as extracting files, listing archive contents, and appending files to archives. It offers options for filtering files based on various criteria, including name, modification time, and permissions, allowing for selective archiving and extraction.
Furthermore, pax can be used for copying directory hierarchies. In copy mode, it duplicates directory structures and files from one location to another, preserving attributes and permissions where possible. The versatility of pax makes it a valuable tool for system administrators, developers, and anyone who needs to manage archive files or copy directory structures.

CAVEATS

Certain archive formats have limitations on filename length or file size. pax may not be able to handle very large files or filenames that exceed the limits of the chosen format. Permissions and ownership might not be preserved perfectly across different operating systems or file systems.

COPY MODE

When invoked with both -r and -w options, pax performs a copy operation, duplicating a directory hierarchy from one location to another. This mode preserves file permissions, ownership, and timestamps where possible, making it a convenient way to create backups or mirror directory structures.

EXTENDED HEADERS

pax supports extended headers, which allow storing additional metadata about files in the archive, such as longer filenames or extended attributes. This is useful for archiving files that exceed the limitations of traditional archive formats.

HISTORY

pax was introduced as part of the POSIX.1-2001 standard. It was created to provide a portable and standardized archive utility that could replace older, less consistent tools like tar and cpio. The development focused on providing a single interface for handling different archive formats, making it easier to manage archive files across various systems. Over time, pax has become a widely adopted tool in Unix-like environments for its versatility and adherence to standards.

SEE ALSO

tar(1), cpio(1), gzip(1), bzip2(1)

Copied to clipboard