patool/doc/patool.1

160 lines
6.3 KiB
Groff
Raw Normal View History

2010-02-21 11:14:57 +00:00
.\" -*- nroff -*-
2016-01-09 20:09:27 +00:00
.\" Copyright (C) 2010-2016 Bastian Kleineidam
2010-02-21 11:14:57 +00:00
.\"
.\" This program is free software: you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation, either version 3 of the License, or
.\" (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
.\" GNU General Public License for more details.
.\"
.TH PATOOL "1" "July 2013" "patool"
2010-02-21 11:14:57 +00:00
.SH NAME
2013-03-28 18:42:02 +00:00
patool - portable archive file manager
2010-02-21 11:14:57 +00:00
.SH SYNOPSIS
2015-07-19 15:29:33 +00:00
\fBpatool\fP [\fIglobal-options\fP] (\fBlist\fP|\fBtest\fP|\fBextract\fP|\fBcreate\fP|\fBdiff\fP|\fBsearch\fP|\fBrepack\fP|\fBrecompressfP|\fBformats\fP) [\fIcommand-options\fP] <\fIcommand-arguments\fP>...
2010-02-21 11:14:57 +00:00
.SH DESCRIPTION
2015-07-19 15:29:33 +00:00
Various archive formats can be created, extracted, tested, listed, searched,
repacked, recompressed and compared by
2010-02-22 17:28:07 +00:00
\fBpatool\fP. The advantage of patool is its simplicity in handling archive
files without having to remember a myriad of programs and options.
.PP
The archive format is determined by the file(1) program and as a fallback
by the archive file extension.
2010-02-21 11:14:57 +00:00
.PP
2016-01-09 19:58:15 +00:00
\fBpatool\fP supports 7z (.7z, .cb7), ACE (.ace, .cba), ADF (.adf),
ALZIP (.alz), APE (.ape), AR (.a), ARC (.arc), ARJ (.arj),
2013-03-12 06:32:59 +00:00
BZIP2 (.bz2), CAB (.cab), COMPRESS (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms),
2016-01-09 19:58:15 +00:00
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), XZ (.xz), ZIP (.zip, .jar, .cbz),
ZOO (.zoo) and ZPAQ (.zpaq) archive formats.
.br
2010-02-21 11:14:57 +00:00
It relies on helper applications to handle those archive formats
(for example bzip2 for BZIP2 archives).
2012-05-12 07:05:20 +00:00
.PP
The archive formats TAR, ZIP, BZIP2 and GZIP
2012-05-12 07:05:20 +00:00
are supported natively and do not require helper applications to be
installed.
.SH EXAMPLES
\fBpatool extract archive.zip otherarchive.rar\fP
\fBpatool --verbose test dist.tar.gz\fP
\fBpatool list package.deb\fP
\fPpatool --verbose create myfiles.zip file1.txt dir/\fP
2013-02-26 19:42:05 +00:00
\fBpatool diff release1.0.tar.xz release2.0.zip\fP
2013-02-22 17:38:52 +00:00
\fBpatool search "def urlopen" python-3.3.tar.gz\fP
2010-03-11 17:33:58 +00:00
\fBpatool repack linux-2.6.33.tar.gz linux-2.6.33.tar.bz2\fP
2015-07-19 15:29:33 +00:00
\fBpatool recompress images.zip\fP
.SH GLOBAL OPTIONS
.TP
\fB\-v\fP, \fB\-\-verbose\fP
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.
2015-12-06 19:09:16 +00:00
.TP
\fB\-\-non\-interactive\fP
Try to prevent any interactive user input (ie. 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.
.br
This only works for programs that allow preventing user prompts. Currently
those are \fBarj\fP, \fB7z\fP and \fBrar\fP.
2010-02-21 11:14:57 +00:00
.SH COMMANDS
2013-02-22 17:38:52 +00:00
The following rules apply to all commands:
.IP "\(bu" 4
Existing files are never overwritten.
.IP "\(bu" 4
The original archive will never be removed.
2013-02-26 19:42:05 +00:00
.IP "\(bu" 4
2013-06-11 19:12:02 +00:00
Files outside the output directory will never be created. This relies on
2013-02-26 19:42:05 +00:00
archive program options to prevent unpacking of files with an absolute
path name (eg. \fB\-\-no\-absolute\-filenames\fP for \fBcpio(1)\fP).
2013-02-22 17:38:52 +00:00
.PP
The following commands are available.
2013-02-22 17:38:52 +00:00
.SS extract
2013-02-26 19:42:05 +00:00
\fBpatool\fP \fBextract\fP [\fB\-\-outdir\fP \fIdirectory\fP] <\fIarchive\fP>...
.PP
Extract files from given archives. The original archives will never
be removed and are left as is.
.TP
2013-02-26 19:42:05 +00:00
\fB\-\-outdir\fP \fIdirectory\fP
Extract to the given output directory. Default is to extract to
the current working directory.
2010-03-18 18:26:07 +00:00
.PP
2012-10-24 21:52:58 +00:00
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
2012-10-24 21:52:58 +00:00
the extension.
2010-03-06 14:23:16 +00:00
.br
This prevents cluttering the output directory with a lot
2010-03-19 12:09:16 +00:00
of files from the extracted archive.
2010-03-18 18:26:07 +00:00
.PP
2010-03-19 12:09:16 +00:00
All extracted files are ensured that they are readable by the
2010-03-06 14:23:16 +00:00
current user.
2013-02-22 17:38:52 +00:00
.SS list
\fBpatool\fP \fBlist\fP <\fIarchive\fP>...
.PP
List files in archives.
2013-02-22 17:38:52 +00:00
.SS create
\fBpatool\fP \fBcreate\fP <\fIarchive\fP> <\fIfile-or-directory\fP>...
.PP
Create an archive from given files. All of the given files to add
to the archive must be readable by the current user.
2010-03-18 18:26:07 +00:00
The format of the archive to create is determined by the archive file
2015-07-19 13:43:21 +00:00
extension. If the archive program has options to maximize file compression,
\fBpatool\fP uses those options.
2013-02-22 17:38:52 +00:00
.SS test
\fBpatool\fP \fBtest\fP <\fIarchive\fP>...
.PP
Test the given archives. If the helper application does not support
2010-03-18 18:26:07 +00:00
testing, the archive contents are listed instead.
2013-02-22 17:38:52 +00:00
.SS diff
\fBpatool\fP \fBdiff\fP <\fIarchive1\fP> <\fIarchive2\fP>
.PP
2013-02-22 17:38:52 +00:00
Show differences between two archives with the \fBdiff(1)\fP program.
2010-03-18 18:26:07 +00:00
The diff options used are \fB\-urN\fP.
2013-02-22 17:38:52 +00:00
.SS search
\fBpatool\fP \fBsearch\fP <\fIpattern\fP> <\fIarchive\fP>
.PP
2013-02-22 17:38:52 +00:00
Search in archive contents for given pattern using the \fBgrep(1)\fP program.
The grep options used are \fB\-r\fP; additional options can be supplied
with the \fBGREP_OPTIONS\fP environment variable.
.SS repack
\fBpatool\fP \fBrepack\fP <\fIarchive\fP> <\fIarchive_new\fP>
.PP
2010-03-18 18:26:07 +00:00
Repackage archive to a different format. The target archive format is
determined by the file extension of \fIarchive_new\fP.
2015-07-19 15:29:33 +00:00
.SS recompress
\fBpatool\fP \fBrecompress\fP <\fIarchive\fP>
.PP
Recompress archive to a smaller file size. If the resulting file is
not smaller, the archive is left unchanged.
2013-02-22 17:38:52 +00:00
.SS formats
\fBpatool\fP \fBformats\fP
.PP
2010-03-18 18:26:07 +00:00
Show all supported archive formats (ie. which helper applications
are available).
.SH HELP OPTION
Specifying the help option displays help for patool itself, or a
command.
.br
For example:
\fBpatool \-\-help\fP - display help for patool
\fBpatool extract \-\-help\fP - display help for the extract command
2013-04-20 07:08:32 +00:00
.SH SHELL ALIASES
When running under a Unix shell the following aliases can be defined to save some typing:
2013-04-20 07:08:32 +00:00
\fBalias pl='patool list'\fP
\fBalias px='patool extract'\fP
\fBalias pc='patool create'\fP
\fBalias pd='patool diff'\fP
2010-02-21 11:14:57 +00:00
.SH AUTHOR
2013-02-22 17:38:52 +00:00
Bastian Kleineidam <bastian.kleineidam@web.de>
2010-02-21 11:14:57 +00:00
.SH COPYRIGHT
2016-01-09 20:09:27 +00:00
Copyright \(co 2010-2016 Bastian Kleineidam