ATOOL(1)
π ATOOL(1) β atool (General Commands Manual) π
okay bestie, this is the atool page: the whole squad of archive-handling commands, all documented with the facts intact and the vibes immaculate. π
β¨ NAME β¨
atool β a script for managing file archives of various types ποΈβ¨
π¦ SYNOPSIS π¦
atool [OPTION]... ARCHIVE [FILE]...
aunpack [OPTION]... ARCHIVE [FILE]...
apack [OPTION]... ARCHIVE [FILE]...
als [OPTION]... ARCHIVE [FILE]...
acat [OPTION]... ARCHIVE [FILE]...
adiff [OPTION]... ARCHIVE ARCHIVE
arepack [OPTION]... OLD-ARCHIVE NEW-ARCHIVE
π DESCRIPTION π
This manual page document describes the atool commands. These commands are used for managing file archives of various types, such as tar and Zip archives. Each command can be executed individually or by giving the appropriate options to atool (see OPTIONS below).
aunpack extracts files from an archive. Often one wants to extract all files in an archive to a single subdirectory. However, some archives contain multiple files in their root directories. The aunpack program overcomes this problem by first extracting files to a unique (temporary) directory, and then moving its contents back if possible. This also prevents local files from being overwritten by mistake. π«Ά
apack creates archives (or compresses files). If no file arguments are specified, filenames to add are read from standard in.
als lists files in an archive.
acat extracts files in an archive to standard out.
adiff generates a diff between two archives using diff(1).
arepack repacks archives to a different format. It does this by first extracting all files of the old archive into a temporary directory, then packing all files extracted to that directory to the new archive. Use the --each (-e) option in combination with --format (-F) to repack multiple archives using a single invocation of atool. Note that arepack will not remove the old archive. π
Unless the --format (-F) option is provided, the archive format is determined by the archive file extension. I.e. an extension .tar.gz or .tgz means tar+gzip format. Note that the extensions are checked in the order listed in the section ARCHIVE TYPES below, which is why a file with extension .tar.gz is considered to be a tar+gzip archive, not a gzip compressed file. π₯
π OPTIONS π
These programs follow the usual GNU command line syntax, with long options starting with two dashes (-). A summary of options is included below.
-l,--listβ List files in archive. This option is automatically assumed whenalsis executed. π-x,--extractβ Extract files from archive. This option is automatically assumed whenaunpackis executed. π¦-X,--extract-to=PATHβ Extract files from archive to the specified directory. When unpacking compressed files, PATH may refer to either a filename or an existing directory.-a,--addβ Create archive. This option is automatically assumed whenapackis executed. β-c,--catβ Extract a file from archive to standard out (displaying it on screen). This option is automatically assumed whenacatis executed. πΊ-d,--diffβ Extract two archives and usediff(1)to generate differences between them. This option is automatically assumed whenadiffis executed.-e,--eachβ For each argument, execute the specified command. This can be used to quickly extract, list or create multiple archives (see EXAMPLES below). This option can not be used with thecatcommand.-F,--format=EXTENSIONβ Specify archive format manually (see ARCHIVE TYPES below).-S,--simulateβ Runatoolin simulation mode. No changes to the filesystem (i.e. writes) will be made, and all commands that would be executed are displayed instead. This option can't be combined with--explain(since it implies that already).
π Note that it is not guaranteed that the commands printed in simulation mode will be the same as those executed in non-simulation mode. This is because some operations depend on what files archives contain, and atool can at this time only determine that by extracting archives.
-E,--explainβ Display commands executed byatool. This option can't be combined with--simulate.-p,--pageβ Run output through a pager, usuallypagerunless the environment variablePAGERis set. π-f,--forceβ When extracting from files, allow overwriting of local files. When creating an archive, allow the archive file to be overwritten if it already exists. Note that it is possible to add files to existing RAR and Zip archives (this is not possible for many other formats). π₯-D,--subdirβ When extracting archives, always create a new directory for the archive even if the archive only contains one file in its root directory.-0,--nullβ If no file arguments are specified when creating or adding files to archives, the list of files will be read from standard in. Normally these filenames are separated by newline, but with this option they are separated by null-bytes. This is useful with the GNUfind -print0option.-q,--quietβ Decrease verbosity level by one. This is subtracted from the default verbosity level, or the level specified with--verbosity. This option may be specified more than once to makeatooleven less verbose. π€«-v,--verboseβ Increase verbosity level by one. This is added to the default verbosity level, or the level specified with--verbosity. This option may be specified more than once to makeatooleven more verbose. π£οΈ-V,--verbosity=LEVELβ Specify verbosity level. The default level is1, which means "normal verbosity" β e.g. when creating and extracting from archives, files will be listed.--config=FILEβ Load configuration from the specified file. When using this option, the system-wide and user-wide configuration files will not be loaded. If the specified file does not exist or can not be read,atoolwill terminate with an error message.-o,--option=KEY=VALUEβ Override a configuration option. These are applied after reading the configuration files.
You can specify this multiple times to override different options.
-O,--format-option=OPTIONβ Send additional options to the archiver command. This can be useful when specifying compression options for some archives, e.g.
apack -F7z -O-mx=9 archive.7z dir
You can specify this multiple times to add different options.
--save-outdir=FILEβ When extracting files, save the name of the directory which the archive was extracted to to the specified file. If the command was notextract, or the archive was not extracted to a new directory, then nothing will be written to the specified file. If multiple archives were specified (with-e), then only the last directory that files were extracted to will be written to FILE.
This option is used internally (see EXAMPLES below).
--helpβ Show summary of options.--versionβ Output version information and exit.
π ARCHIVE TYPES π
Unless the -f (--format) option is provided β okay, quick vibe check: the page literally says -f here, but the --format flag in OPTIONS is -F, and -f is force, so keep that straight bestie π β the archive format is determined by the archive file extension. I.e. an extension .tar.gz or .tgz means tar+gzip format. Note that the extensions are checked in the order listed above, which is why a file with extension .tar.gz is considered a tar+gzip archive, not a gzip archive.
The diff command is supported whenever the extract command is supported.
The supported archive types are:
tar+gzip(.tar.gz,.tgz) β All commands are supported.tar+bzip(.tar.bz,.tbz) β All commands are supported.tar+bzip2(.tar.bz2,.tbz2) β All commands are supported.tar+compress(.tar.Z,.tZ) β All commands are supported.tar+lzop(.tar.lzo,.tzo) β All commands are supported.tar+lzip(.tar.lz,.tlz) β All commands are supported.tar+xz(.tar.xz,.txz) β All commands are supported.tar+7z(.tar.7z,.t7z) β All commands are supported.tar(.tar) β All commands are supported.zip(.zip) β All commands are supported.jar(.jar,.war) β List, extract, and add commands are supported. Cat is supported ifuse_jar_programis disabled.rar(.rar) β All commands are supported.lha(.lha,.lzh) β All commands are supported.7z(.7z) β Extract, list and add commands are supported.alzip(.alz) β Extract command is supported.ace(.ace) β Extract and list commands are supported.ar(.a) β All commands are supported.arj(.arj) β List, extract and add commands are supported.arc(.arc) β All commands are supported. Note thatarcoutputs an extra newline when thecatcommand is used.rpm(.rpm) β Extract and list commands are supported.deb(.deb) β Extract and list commands are supported.cab(.cab) β Cat, extract, and list commands are supported.gzip(.gz) β Cat, extract, and add commands are supported.bzip(.bz) β Cat, extract, and add commands are supported.bzip2(.bz2) β Cat, extract, and add commands are supported.compress(.Z) β Cat, extract, and add commands are supported.lzma(.lzma) β Cat, extract, and add commands are supported.lzop(.lzo) β Extract and add commands are supported. The cat command is not supported becauselzopdoes not want to extract files to standard out unless the-fflag is given.lzip(.lz) β Cat, extract, and add commands are supported.xz(.xz) β Cat, extract, and add commands are supported.rzip(.rz) β Extract and add commands are supported.lrzip(.lrz) β Extract and add commands are supported.7zip(.7z) β All commands are supported. Note that7zrefuses to write extracted files to standard out if standard out is a terminal. Use-por pipe the output ofatool/acatto a pager when reading in a terminal.cpio(.cpio) β List, extract and add commands are supported.
β¨ CONFIGURATION β¨
okay so bestie, since version 0.8.0, atool can read custom configuration files, and the order is literally important. First, hardcoded defaults in the atool program file are evaluated. Then system-wide configuration values are loaded from /etc/atool.conf if that file exists. Finally, per-user configuration values are loaded from .atoolrc in the current user's home directory. periodt. π
The format of the configuration files is simple:
variable value
Here variable is a variable listed below, and value is the value to associate the variable with. variable and value should be separated with at least one whitespace (space, tab etc). Empty lines and lines beginning with # are discarded.
A value of 1 means that the option is enabled, and 0 that it is disabled. Strings should not be quoted, as they start at the first non-whitespace character and end at the end of the line.
tiny but real warning: no quotes on strings, bestie β theyβd just become part of the value. iykyk π«Ά
π the options π
use_tar_bzip2_option(default:1) β Enable this if you use GNU tar and it supports the--bzip2option for filtering bzip2'ed files through bzip2. Versions1.13.6or later of GNU tar support--bzip2. Therefore, if you use GNU tar earlier than1.13.6, you will need to disable this option. This used to beuse_tar_j_optionbut using--bzip2is more portable. slay for portability β¨use_tar_lzip_option(default:0) β Enable this if you use GNU tar and it supports the--lzipoption for filtering lzip'ed files through lzip. Versions1.23or later of GNU tar support--lzip. Therefore, if you use GNU tar earlier than1.23, you will need to disable this option.use_tar_z_option(default:1) β Enable this if you use GNU tar and it supports the-zoption for filtering gzipped files through gzip. You will need to disable this anduse_tar_j_optionif you don't use GNU tar. Disabling these two options doesn't mean thatatoolcan't extract bzip2/gzip files β if disabled,atooluse a pipe to send output from bzip2/gzip to tar instead. If possible, these options should be enabled since error management is better when filtering is done by tar. the way tar handles errors better is lowkey iconic πuse_tar_lzma_option(default:1) β Enable this if you use GNU tar and it supports the--lzmaoption for filtering lzma compressed files through lzma. Versions1.20or later of GNU tar support--lzma.use_tar_lzop_option(default:0) β Enable this if you use GNU tar and it supports the--lzopoption for filtering lzop compressed files through lzop. Versions1.21or later of GNU tar support--lzop.use_tar_xz_option(default:0) β Enable this if you use GNU tar and it supports the--xzoption for filtering xz compressed files through xz. Versions1.22or later of GNU tar support--xz.use_gzip_for_z(default:1) β Enable this if you want to use gzip instead of uncompress when decompressing compress'ed files (.Zfiles). compress'ed is such an old-school vibe ngl πuse_rar_for_unpack(default:0) β Enable this if you want to always use rar instead of unrar when possible. This makesatooluse the rar command (path_rar) even when listing and extracting RAR files.use_arc_for_unpack(default:0) β Enable this if you want to always use arc instead of nomarch when possible. This makesatooluse the arc command (path_arc) even when listing and extracting ARC files.use_arj_for_unpack(default:0) β Enable this if you want to always use arj instead of unarj when possible. This makesatooluse the arj command (path_arj) even when listing and extracting ARJ files.use_find_cpio_print0(default:1) β Enable this if find supports the-print0option and cpio supports the-0option. Without it, it is impossible/harder to make cpio archives of files with newline characters in their names. newlines in filenames are chaos and we love that for them πextract_deb_control(default:1) β Debian.debpackage files contain control information in aDEBIANdirectory, especially the package's"control"file. Enable this if you want the control information to be extracted during extraction in addition to the normal files.strip_unknown_ext(default:1) β Certain types of files are actually archives, but their extensions doesn't tell so. Examples are Open Office documents (Zip files) and Gnumeric documents (gzip'ed files). Since the extensions of those filenames are unknown toatool, they would not be stripped with this option set to0. The output file in that case would be something likeUnpack-XYZW. Setting this option to1will cause the extension to be stripped instead. Unpack-XYZW is giving temp-file main character energy πuse_pbzip2(default:0) β Enable this if you want to use pbzip2 rather than bzip2. Please note that ifuse_tar_bzip2_optionis enabled, then bzip2 will be used by tar regardless of theuse_pbzip2option. So if you want tar to use pbzip2 rather than bzip2, setuse_pbzip2to1anduse_tar_bzip2_optionto0.use_lbzip2(default:0) β Enable this if you want to use lbzip2 rather than bzip2. Please note that ifuse_tar_bzip2_optionis enabled, then bzip2 will be used by tar regardless of theuse_lbzip2option. So if you want tar to use lbzip2 rather than bzip2, setuse_lbzip2to1anduse_tar_bzip2_optionto0.use_pigz(default:0) β Enable this if you want to use pigz rather than gzip. Please note that ifuse_tar_z_optionis enabled, then gzip will be used by tar regardless of theuse_pigzoption. So if you want tar to use pigz rather than gzip, setuse_pigzto1anduse_tar_z_optionto0. pigz my beloved π·use_plzip(default:0) β Enable this if you want to use plzip rather than lzip. Please note that ifuse_tar_lzip_optionis enabled, then lzip will be used by tar regardless of theuse_plzipoption. So if you want tar to use plzip rather than lzip, setuse_plzipto1anduse_tar_lzip_optionto0.use_jar(default:0) β Enable this if you want to use jar for managing jar archives. If you disable this option, zip will be used (which should work just as well, and probably be faster too). This option is disabled by default since extracting files to standard out (cat) is not supported by jar. no cat support? jar could never πuse_file(default:1) β Enable this if you wantatoolto identify file types usingfile(1)for those files with an unrecognized extension (or none at all).use_file_always(default:0) β Enable this if you wantatoolto always identify archives usingfile(1), regardless of the file extension. Please note that this currently has some drawbacks, such as not being able to identify all archive types (especially tar archives compressed with 7zip, lzop, szip etc). drawback alert: it sounds cute but it canβt catch everything. πtmpdir_name(default:Unpack-%04d) βatoolextracts to a temporary directory created in the current directory so that no files are overwritten. This variable controls what name that temporary directory should have. The%dstring in this variable will be replaced with a random number between0and9999. It is possible change the format of this number by using something else than%dβ seeprintf(3). random number formatting is so printf core πtmpfile_name(default:Pack-%04d) β When using pbzip2, and creating archives, a temporary file need to be created. This option controls the name of that file. Seetmpdir_namefor further details on the format.
π§ paths to literally every program π§
path_pager(default:pager)path_jar(default:jar)path_tar(default:tar)path_zip(default:zip)path_unzip(default:unzip)path_gzip(default:gzip)path_bzip(default:bzip)path_bzip2(default:bzip2)path_pbzip2(default:pbzip2)path_compress(default:compress)path_lzma(default:lzma)path_lzop(default:lzop)path_lzip(default:lzip)path_rar(default:rar)path_unrar(default:unrar)path_lbzip2(default:lbzip2)path_pigz(default:pigz)path_cabextract(default:cabextract)path_7z(default:7z)path_unalz(default:unalz)path_lha(default:lha)path_unace(default:unace)path_ar(default:ar)path_arj(default:arj)path_unarj(default:unarj)path_arc(default:arc)path_nomarch(default:nomarch)path_rpm(default:rpm)path_rpm2cpio(default:rpm2cpio)path_dpkg_deb(default:dpkg-deb)path_cpio(default:cpio)path_file(default:file)path_find(default:find)path_xargs(default:xargs)path_cat(default:cat)path_diff(default:diff)
These are all paths to the corresponding programs. It is usually best to leave them as is, because that way their locations can be looked up from the PATH variable. PATH lookup just hits different π
args_diff(default:-ru) β This variable specifies command line arguments to pass to the diff command (as specified bypath_diff) when usingadiff. Space characters separate arguments in this string.path_syscfg(default:/etc/atool.conf) β (This variable can only be set in theatoolprogram file.) This variable specifies the directory where the system-wide configuration file is located.path_usercfg(default:.atoolrc) β (This variable can only be set in theatoolprogram file and system-wide configuration file.) This variable specifies where the user configuration file is located. Note that if this filename is relative (i.e. doesn't begin with/), it will be relative to the current user's home directory (as determined by theHOMEenvironment variable). HOME is home, bestie πdefault_verbosity(default:1) β This is the default verbosity ofatool. By using-qand-voptions, the verbosity level can be raised and lowered. Level1means"normal verbosity"β e.g. when creating and extracting from archives, files will be listed.show_extracted(default:1) β If this is set to1, theaunpackcommand will always show what file or directory that was extracted. Otherwise that will only be printed if the archive was extracted to an unexpected location (as a result of local files already existing or the archive having multiple files in its root directory). This can be quite useful in combination withdefault_verbosity 0. Note that this option will have no effect when the-Xoption is used withaunpack, and it has no effect on compressed files. unexpected extraction location is not the vibe, but at least it tells you π¦keep_compressed(default:1) β okay so when you compress a file withgziporbzip2, the original (uncompressed) file is usually deleted once it has been compressed. Like, if you compress a filetest, youβll end up with only one file:test.gz. With this option set to1, you makeatoolkeep the original file as well. The original behaviour is achieved by setting this option to0. slay, now you have both.
This option also has an equivalent effect on uncompressing compressed files. When set to 1, the original (compressed) file will be kept. Otherwise it will be deleted.
Note however that this option has no effect when packing up a compressed file with the -X option (for specifying an output directory or file). In that case the original file is always kept.
decompress_to_cwd(default:1) β when decompressing a file with commands such asgziporbzip2, the decompressed file is usually placed in the same directory as the compressed file. With this option set to1, the decompressed file is instead placed in the current working directory. cute little relocation moment.
Note that this option has no effect when -X is used.
β¨ ENVIRONMENT VARIABLES β¨
PAGERβ the default pager to use when the-p/--pageoption is specified. periodt.
πΈ EXAMPLES πΈ
Bestie, here are the little recipes from the page β every command stays exactly as written:
To extract all files from archive foobar.tar.gz to a subdirectory (or the current directory if it only contains one file):
aunpack foobar.tar.gz
To extract all files from all .tar.gz archives in the current directory:
aunpack -e *.tar.gz
To create a zip archive of two files foo and bar:
apack myarchive.zip foo bar
To display the file baz in the archive myarchive.zip through a pager:
acat -p myarchive.zip baz
To list contents of the rar archive stuff.rar:
als stuff.rar
To create three archives, dir1.tar.gz, dir2.tar.gz and dir3.tar.gz, so that the first one contains all files in dir1, the second all in dir2 and the third all dir3:
apack -e -F .tar.gz dir1 dir2 dir3
To show all differences between version 2.4.17 and 2.4.18 of the kernel:
adiff linux-2.4.17.tar.gz linux-2.4.18.tar.gz
To repack all .tar.gz archives in the current directory to .tar.7z (the old archive will be kept untouched):
arepack -F.tar.7z -e *.tar.gz
Hereβs a shell function that will make the aunpack command change into the directory where files were extracted:
aunpack () {
TMP=`mktemp /tmp/aunpack.XXXXXXXXXX`
atool -x --save-outdir=$TMP "$@"
DIR="`cat $TMP`"
[ "$DIR" != "" -a -d "$DIR" ] && cd "$DIR"
rm $TMP
}
If you donβt have the mktemp program, you can replace the second line with (note however that this is not entirely safe)
TMP="/tmp/atool_outdir.$$"
π KNOWN BUGS π
Trying to extract gzip and other compressed files without the .gz (or .bz2 etc) extension wonβt work:
aunpack: foo: format not known, identifying using file
aunpack: foo: format is `gzip'
gzip: foo: unknown suffix -- ignored
This last error above is generated by gzip -d foo.
If you find a bug not listed here, please report it to <oskar@osk.mine.nu>.
π REPORTING BUGS π
Report bugs to <oskar@osk.mine.nu>.
π AUTHOR π
The author of atool and this manual page is Oskar Liljeblad <oskar@osk.mine.nu>.
π COPYRIGHT π
Copyright Β© 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2011, 2012 Oskar Liljeblad
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
π
Thatβs the whole manual, bestie β atool, ATOOL(1), dated August 8, 2009. Stay iconic and archive-safe. π«Ά
π¦ where this page comes from
- arch rolling: atool 0.39.0-10 Β· GPL3
- epel 9: atool 0.39.0-19.el9 Β· GPLv2+
- fedora 43: atool 0.39.0-28.fc43 Β· GPL-2.0-or-later
- fedora 44: atool 0.39.0-30.fc44 Β· GPL-2.0-or-later
- nixos 26.05: atool 0.39.0
- nixpkgs unstable: atool 0.39.0
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 2009, 2011 Oskar Liljeblad
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms