Skip to content

Instantly share code, notes, and snippets.

@alexbain
Last active December 30, 2015 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexbain/434464745642bc97d9fc to your computer and use it in GitHub Desktop.
Save alexbain/434464745642bc97d9fc to your computer and use it in GitHub Desktop.
Extract all .7z files in a directory into subdirectories that match the file name
#!/bin/bash
for i in *.7z; do
subdirectory_name=$(echo $i | sed 's/.7z//');
7z x "$i" -o"$subdirectory_name"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment