LinuxCommandLibrary

patool

Extract, create, test, and list archive contents

TLDR

Extract an archive

$ patool extract [path/to/archive]
copy

Create an archive
$ patool create [/path/to/archive] [/path/to/file1] [/path/to/file2] [/path/to/dir1/] [/path/to/dir2/]
copy

List contents of an archive
$ patool list [path/to/archive]
copy

Compare the contents of two archives and display the differences in the standard output
$ patool diff [path/to/archive1] [path/to/archive2]
copy

Search for a string inside the contents of an archive
$ patool search [path/to/archive]
copy

SYNOPSIS

patool {command} [options] archive [files]

PARAMETERS

create
    Creates a new archive file.

extract
    Extracts the contents of an archive.

test
    Tests the integrity of an archive.

list
    Lists the contents of an archive.

--version
    Shows program's version number and exit

--help
    Shows program's help message and exit

--verbose
    Provides verbose output during the operation.

--noninteractive
    Suppresses interactive prompts.

--outdir=
    Specifies the output directory for extracted files.

DESCRIPTION

Patool is a command-line tool for working with archive files. It allows users to easily create, extract, test, and list the contents of various archive formats, including zip, tar, gzip, bzip2, 7z, rar, and more. Patool aims to provide a consistent interface to different archivers and simplifies common archive operations.
It automatically determines the archive type and calls the appropriate underlying archiving program, like `zip`, `tar`, `unrar`, etc. It acts as a wrapper, abstracting away the specific command-line syntax of each archiver. This makes managing archives much easier for users who don't want to remember the specific commands for each format. Patool is particularly useful for scripting and automation of archive management tasks. Patool relies on external programs for handling different archive formats, so you need to install them separately.

CAVEATS

Patool depends on external archivers being installed on your system. If an archiver for a specific format is missing, patool will not be able to handle archives of that type. Ensure that the necessary archivers (e.g., `zip`, `unzip`, `tar`, `gzip`, `bzip2`, `7z`, `rar`) are installed before using patool.

ARCHIVE TYPE DETECTION

Patool intelligently detects the archive type based on the file extension or file content. This removes the need to manually specify the archive format.

FILE SELECTION

During archive creation, Patool can accept multiple files or directories as input. This enables creating archives from diverse file sets.

HISTORY

The need to manage different archive formats (tar, zip, rar, etc.) using a single command line interface inspired the creation of Patool. This command line utility was created to simplify archive management tasks and reduce the need to remember various syntaxes.

SEE ALSO

tar(1), gzip(1), zip(1), unzip(1), rar(1)

Copied to clipboard