Tips on Linux

How to unzip all 7z files in a directory?

One can use the following bash script to unzip all *.7z files in a directory.

shopt -s nullglob
for f in $FILES
    echo "Processing $f file ..."
    7za x $f -o$2

Save the script as

$ chmod +x
$ ./ /path/to/7z/file/directory /path/to/target/directory</pre>
This entry was posted in Linux. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *