← 返回命令列表

Linux command

atool 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Extract an archive (auto-detects format)

atool -x [archive.tar.gz]

List archive contents

atool -l [archive.zip]

Create an archive from files or directories

atool -a [output.tar.gz] [file1] [file2]

Extract into a specific directory

atool -X [/path/to/dir] [archive.zip]

Extract each archive in the current directory

atool -e -x *.zip

Print a file from an archive to standard output

atool -c [archive.tar.gz] [path/inside/archive]

Show the diff between two archives

atool -d [old.tar.gz] [new.tar.gz]

说明

Manage archives in various formats with a unified interface

参数

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

FAQ

What is the atool command used for?

Manage archives in various formats with a unified interface

How do I run a basic atool example?

Run `atool -x [archive.tar.gz]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l, --list do in atool?

List the contents of an archive.