logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

patool - portable archive file manager

Author

       Bastian Kleineidam <bastian.kleineidam@web.de>

Commands

       The following rules apply to all commands:

       •   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)).

       The following commands are available.

   extractpatoolextract [--outdirdirectory] <archive>...

       Extract files from given archives. The original archives will never be removed and are left as is.

       --outdirdirectory
              Extract to the given output directory. Default is to extract to the current working directory.

       If the archive contains exactly one file or directory, the archive contents are extracted directly to the
       output  directory.  Else the files are extracted in a newly created subdirectory of the output directory.
       The new directory is named after the archive filename without the extension.
       This prevents cluttering the output directory with a lot of files from the extracted archive.

       All extracted files are ensured that they are readable by the current user.

       If extracting an archive has an error in the middle of operation, patool does not  remove  the  temporary
       extraction  directory  This  directory  whose  name  starts  with  "Unpack_" has all files that have been
       extracted before the error.

   listpatoollist <archive>...

       List files in archives.

   createpatoolcreate <archive> <file-or-directory>...

       Create an archive from given files. All of the given files to add to the archive must be readable by  the
       current  user.   The  format of the archive to create is determined by the archive file extension. If the
       archive program has options to maximize file compression, patool uses those options.

   testpatooltest <archive>...

       Test the given archives. If the helper application does not support testing,  the  archive  contents  are
       listed instead.

   diffpatooldiff <archive1> <archive2>

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

   searchpatoolsearch <pattern> <archive>

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

   repackpatoolrepack <archive> <archive_new>

       Extract  and  re-compress  archive to a different format.  The target archive format is determined by the
       file extension of archive_new.

   formatspatoolformats

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

   versionpatoolversion

       Print version information.

Description

       Various archive formats can be created, extracted, tested, listed, searched,  repacked  and  compared  by
       patool.  The advantage of patool is its simplicity in handling archive files without having to remember a
       myriad of programs and options.

       The archive format is determined by the file(1) program and as a fallback by the archive file extension.

       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), 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.
       It relies on helper applications to handle those archive formats (for example xz for XZ (.xz) archives).

       The archive formats TAR,  ZIP,  BZIP2  and  GZIP  are  supported  natively  and  do  not  require  helper
       applications to be installed.

Examples

patoolextractarchive.zipotherarchive.rarpatool--verbosetestdist.tar.gzpatoollistpackage.debpatool--verbosecreatemyfiles.zipfile1.txtdir/patooldiffrelease1.0.tar.xzrelease2.0.zippatoolsearch"defurlopen"python-3.3.tar.gzpatoolrepacklinux-2.6.33.tar.gzlinux-2.6.33.tar.bz2

Global Options

-v, --verbose
              Display  more  info  about what patool does, and display the output of helper applications. Can be
              given multiple times to increase the output even more.

       -q, --quiet
              Work quietly, exept on commands formats and version, which still  print  their  output.  Conflicts
              with --verbose.  If given twice suppresses error output from archive commands.

       --non-interactive
              Try  to  prevent  any  interactive  user  input  (i.e.  prompting for passwords or for overwriting
              duplicate files). Use this option with care since overwriting files or ignoring  password  prompts
              could lead to unintended consequences.
              This  only  works for programs that allow preventing user prompts. Currently those are arj, 7z and
              rar.

Help Option

       Specifying the help option displays help for patool itself, or a command.
       For example:
         patool--help - display help for patool
         patoolextract--help - display help for the extract command

Name

       patool - portable archive file manager

Shell Aliases

       When running under a Unix shell the following aliases can be defined to save some typing:
         aliaspl='patoollist'aliaspx='patoolextract'aliaspc='patoolcreate'aliaspd='patooldiff'

Synopsis

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

See Also