LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

atool

Manage archives in various formats with a unified interface

TLDR

Extract an archive (auto-detects format)
$ atool -x [archive.tar.gz]
copy
List archive contents
$ atool -l [archive.zip]
copy
Create an archive from files or directories
$ atool -a [output.tar.gz] [file1] [file2]
copy
Extract into a specific directory
$ atool -X [/path/to/dir] [archive.zip]
copy
Extract each archive in the current directory
$ atool -e -x *.zip
copy
Print a file from an archive to standard output
$ atool -c [archive.tar.gz] [path/inside/archive]
copy
Show the diff between two archives
$ atool -d [old.tar.gz] [new.tar.gz]
copy

SYNOPSIS

atool [-lxacdX] [options] archive [files...]

PARAMETERS

-l, --list

List the contents of an archive.
-x, --extract
Extract files from an archive. By default a unique subdirectory is created if the archive is not already tidy.
-X PATH, --extract-to=PATH
Extract the archive into the given directory.
-a, --add
Create a new archive from the supplied files. The archive format is inferred from the output file's extension.
-c, --cat
Extract a single file from the archive to standard output.
-d, --diff
Extract two archives and run diff(1) on their contents.
-e, --each
Perform the requested action on each of the remaining arguments individually (useful for batch extraction).
-F EXT, --format=EXT
Override automatic format detection.
-O OPT, --format-option=OPT
Pass an extra option to the underlying archiver (for example `-O-mx=9` to set 7z compression level).
-D, --subdir
Always create a subdirectory when extracting, even if the archive already contains a top-level directory.
-f, --force
Overwrite existing files or archives without asking.
-S, --simulate
Show what would be done without modifying the filesystem.
-E, --explain
Print the underlying commands that atool runs.
-p, --page
Pipe output through a pager.
-q, --quiet
Decrease verbosity.
-v, --verbose
Increase verbosity.
-o KEY=VAL, --option=KEY=VAL
Override a configuration setting on the command line.
--config=FILE
Load a non-default configuration file.

CONFIGURATION

~/.atoolrc

Per-user configuration file that sets defaults and format preferences.
/etc/atoolrc
System-wide configuration file.

RELATED COMMANDS

aunpack archive

Shortcut for `atool -x`; also cleans up if the archive is untidy.
apack archive files...
Shortcut for `atool -a`.
als archive
Shortcut for `atool -l`.
acat archive file
Shortcut for `atool -c`.
adiff archive1 archive2
Shortcut for `atool -d`.
arepack old new
Convert one archive format to another in a single step.

SUPPORTED FORMATS

- tar (plain, gzip, bzip2, xz, lzma, zstd, compress)- zip, jar, war- rar, 7z, lzh, arj, arc- ar, cpio, shar- deb, rpm (for listing/extraction via backend tools)

CAVEATS

Requires the appropriate backend tools to be installed (tar, unzip, unrar, 7z, zstd, ...); atool only orchestrates them. Archive format detection is primarily based on file extension, so -F may be needed when extensions are missing or misleading.

HISTORY

atool is written in Perl by Oskar Liljeblad and is distributed by the GNU project (nongnu.org/atool). It was created to provide a unified front end for the large number of archive formats found on Unix systems.

SEE ALSO

tar(1), unzip(1), 7z(1), unrar(1), unar(1), zip(1), gzip(1), bzip2(1), xz(1), zstd(1)

Copied to clipboard
Kai