---
title: "atools: unpack file archives agnostically"
url: https://perrotta.dev/2024/12/atools-unpack-file-archives-agnostically/
last_updated: 2025-09-05
---


When downloading software from the interwebs, it can come in many popular
archive formats: `.zip`, `.tar.gz`, `.tar.xz`, `.rar`, `.7z`, etc.

If you extract them via the CLI, normally you have to remember the right command
and flags to pass for each different format, e.g.:

```shell
% unzip foo.zip
% tar xzvf foo.tar.gz
[...]
```

It's not too bad but it's unnecessary overhead that can be abstracted away. And
there are several ways to do so.

At some point I used [`dtrx`](https://github.com/dtrx-py/dtrx):

```shell
% dtrx vault_1.7.2_linux_amd64.zip
```

...but it used to be Python 2 only. These days there is a Python 3 version but
it was too late, at some point I switched to `atool`:

```shell
% brew ls atool
/opt/homebrew/Cellar/atool/0.39.0/bin/acat
/opt/homebrew/Cellar/atool/0.39.0/bin/adiff
/opt/homebrew/Cellar/atool/0.39.0/bin/als
/opt/homebrew/Cellar/atool/0.39.0/bin/apack
/opt/homebrew/Cellar/atool/0.39.0/bin/arepack
/opt/homebrew/Cellar/atool/0.39.0/bin/atool
/opt/homebrew/Cellar/atool/0.39.0/bin/aunpack
/opt/homebrew/Cellar/atool/0.39.0/share/man/ (7 files)
```

The only command I use from the package is `aunpack`, which behaves similarly to
`dtrx`:

```shell
% aunpack vault_1.7.2_linux_amd64.zip
```

`atool` is [globally available](https://repology.org/project/atool/versions) in
all software repositories I care about.

And then I can free up my mind.
With that said, it's still useful to remember the unpacking commands for at the very least `.zip` and `.tar.gz`.

