PATOOL(1)

✨ PATOOL ✨

okay bestie, gather round, because i'm about to put you onto patool β€” the portable archive file manager for the command line πŸ’– and yes, it's literally in the General Commands Manual section, we're fancy like that.


πŸŽ€ SYNOPSIS πŸŽ€

patool [global-options]
(list|test|extract|create|diff|search|repack|formats|version) [command-
options] [command-arguments]...

🌸 DESCRIPTION 🌸

so here's the vibe: patool can create, extract, test, list, search, repack and compare a whole galaxy of archive formats 🌈 and the whole point, the entire reason she exists, is simplicity. you do NOT have to memorize a myriad of programs and options. that's the whole flex. no cap.

the archive format gets figured out by the file(1) program, and if that doesn't work out, it falls back to the archive file extension πŸ¦‹

now. the format list. she's long. she's iconic. she ate:

patool supports 7z (.7z, .cb7), ACE (.ace, .cba), ADF (.adf), ALZIP (.alz), APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), BZIP3 (.bz3), CAB (.cab), CHM (.chm), COMPRESS (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms), FLAC (.flac), FREEARC (.arc), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh), LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar, .cbr), RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), UDF (.udf), XZ (.xz), ZIP (.zip, .jar, .cbz), ZOO (.zoo), ZPAQ (.zpaq) and ZSTANDARD (.zst) archive formats πŸ’…

and yeah, she relies on helper applications to handle those formats (like, xz for XZ (.xz) archives, you get it).

but wait πŸ‘‘ the formats BZIP2, GZIP, TAR, XZ and ZIP are supported natively β€” no helper applications required, they're just built in. and when you're using Python >= 3.14, the ZSTANDARD archive format is also supported natively. periodt.


πŸ”₯ EXAMPLES πŸ”₯

patool extract archive.zip otherarchive.rar
patool --verbose test dist.tar.gz
patool list package.deb
patool --verbose create myfiles.zip file1.txt dir/
patool diff release1.0.tar.xz release2.0.zip
patool search "def urlopen" python-3.3.tar.gz
patool repack linux-2.6.33.tar.gz linux-2.6.33.tar.bz2

πŸ’… GLOBAL OPTIONS πŸ’…

  • -v, --verbose β€” shows you more info about what patool is doing, and it also displays the output of helper applications. stack it multiple times to crank the output even higher πŸ“ˆ
  • -q, --quiet β€” work quietly, EXCEPT the formats and version commands still print their output, because they refuse to be silenced 🫢. this one conflicts with --verbose. and if you give it twice, it suppresses error output from archive commands.
  • --non-interactive β€” tries to prevent any interactive user input (so like, no prompting for passwords, no prompting about overwriting duplicate files). ⚠️ use this option with care, bestie, because overwriting files or ignoring password prompts could lead to unintended consequences. also note this only works for archive programs that actually allow preventing user prompts β€” currently those are arj, 7z and rar.

πŸ‘‘ COMMANDS πŸ‘‘

the following rules apply to all commands, no exceptions:

  • Existing files are never overwritten.
  • The original archive will never be removed.
  • Files outside the output directory will never be created. this relies on archive program options to prevent unpacking of files with an absolute path name (e.g. --no-absolute-filenames for cpio(1)).

and here's the lineup of commands available:

πŸ“¦ extract

patool extract [--outdir directory] [--password password] <archive>...

Extract files from given archives. the original archives will never be removed and are left as is, we respect them.

  • --outdir directory β€” extract to the given output directory. default is to extract to the current working directory.
  • --password password β€” use given password for password-protected archives.

here's the cute part: if the archive contains exactly one file or directory, the archive contents get extracted directly into the output directory. else, the files are extracted into a newly created subdirectory of the output directory. that new directory is named after the archive filename without the extension. this prevents cluttering your output directory with a million files from the extracted archive, which is so thoughtful of her honestly 🧚

all extracted files are ensured to be readable by the current user.

and if extracting an archive hits an error in the middle of the operation, patool does not remove the temporary extraction directory. that directory, whose name starts with Unpack_, has all the files that got extracted before the error. so you can go poke around in there 😭

πŸ“‹ list

patool list [--password password] <archive>...
  • --password password β€” use given password for password-protected archives.

List files in archives. that's it, that's the whole thing.

πŸ› οΈ create

patool create [--password password] <archive> <file-or-directory>...
  • --password password β€” use given password for password-protected archives.

Create an archive from given files. all of the given files you're adding to the archive must be readable by the current user. the format of the archive to create is determined by the archive file extension πŸ“Ž and if the archive program has options to maximize file compression, patool uses those options. she's giving main character efficiency.

πŸ§ͺ test

patool test [--password password] <archive>...
  • --password password β€” use given password for password-protected archives.

Test the given archives. if the helper application doesn't support testing, the archive contents are listed instead. improvise, adapt, slay.

πŸ” diff

patool diff <archive1> <archive2>

Show differences between two archives using the diff(1) program. the diff options used are -urN.

patool search [--password password] <pattern> <archive>
  • --password password β€” use given password for password-protected archives.

Unpack the given archive into a temporary directory and search the archive contents for the given pattern using the grep(1) program. the grep options used are -r; additional options can be supplied with the GREP_OPTIONS environment variable 🌈

♻️ repack

patool repack <archive> <archive_new>

Extract and re-compress an archive to a different format. the target archive format is determined by the file extension of archive_new. glow-up but for file formats.

πŸ“œ formats

patool formats

Show all supported archive formats (i.e. which helper applications are available).

🏷️ version

patool version

Print version information.


πŸ™‹ HELP OPTION πŸ™‹

specifying the help option -h or --help displays help for patool itself, or for a command. for example:

patool -h - display help for patool
patool extract --help - display help for the extract command

🫢 AUTHOR 🫢

Bastian Kleineidam <bastian.kleineidam@web.de>


Copyright Β© 2010-2026 Bastian Kleineidam


and that's the whole page bestie, you're officially a patool expert πŸ’– this was the patool manual, January 2026 edition, and honestly? iconic. go extract something. mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from