Forrest logo
back to the atool tool

atool:tldr:aac84

atool: Extract all zip and rar archives in the current directory.
$ atool --each --extract ${*-zip *-rar}
try on your machine

The command atool --each --extract ${*-zip *-rar} is used to extract multiple files with different formats using the atool command-line tool.

Here is a breakdown of the command:

  • atool: It refers to the atool command-line tool which is used for file compression and extraction. It supports various archive formats.

  • --each: It is an option used to perform the specified action on each file individually. In this case, it will extract each file individually.

  • --extract: It is an option used to specify that the action to be performed is extraction. It tells atool to extract the files.

  • ${*-zip *-rar}: This is a shell expansion syntax that is used to expand to a list of filenames matching the patterns *-zip and *-rar.

    • *-zip: This pattern matches any file ending with .zip.
    • *-rar: This pattern matches any file ending with .rar.

    The ${*} part is used to refer to all the command-line arguments passed to the script or command. So, ${*-zip *-rar} will expand to a list of filenames that end with .zip or .rar based on the files present in the current working directory or the arguments passed.

Overall, the command atool --each --extract ${*-zip *-rar} will extract each file individually from the arguments that end with .zip or .rar using the atool command-line tool.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the atool tool