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 whatpatoolis 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 theformatsandversioncommands 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 arearj,7zandrar.
π 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-filenamesforcpio(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.
--outdirdirectory β extract to the given output directory. default is to extract to the current working directory.--passwordpassword β 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>...
--passwordpassword β 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>...
--passwordpassword β 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>...
--passwordpassword β 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.
π search
patool search [--password password] <pattern> <archive>
--passwordpassword β 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 β
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
- fedora 44: patool 4.1.0-1.fc44 Β· GPL-3.0-or-later
- ubuntu stonking: patool 4.0.5-0.1 Β· GPL-3.0-or-later
- Copyright (C) 2010-2026 Bastian Kleineidam
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms