Skip to content

Instantly share code, notes, and snippets.

@abdennour
Created January 6, 2023 05:12
Show Gist options
  • Save abdennour/3d3f9b686c6fde7c08f42310f3c40288 to your computer and use it in GitHub Desktop.
Save abdennour/3d3f9b686c6fde7c08f42310f3c40288 to your computer and use it in GitHub Desktop.
In Parallel TAR Archive Subfolders - Bash
src=$1
dest=$2
cd ${src}
for i in *
do
(
if [ -d "$i" ];then
tar czvf "${dest}/$i.tar.gz" -C "$i" .
else
echo skiping $i as it is not folder
fi
sleep 1
) &
done
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment