Created
April 24, 2018 05:52
-
-
Save Hylke1982/d0e534a0108529e7d4c631d34cd157d7 to your computer and use it in GitHub Desktop.
Extract .tar.gz2 recursive in their directories
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in **/*.tar.bz2; do # Whitespace-safe and recursive | |
last=${i##*/} | |
directory="${i%/*}" | |
file=${last%%.*} | |
echo "$directory|$file|$last" | |
targetDir="$directory/$file" | |
mkdir -p $targetDir | |
tar xvjf $i -C $targetDir | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment