Skip to content

Instantly share code, notes, and snippets.

@AmirAref
Created September 30, 2022 11:56
Show Gist options
  • Save AmirAref/e1e437d28b6f2def91ae130ae08e5c78 to your computer and use it in GitHub Desktop.
Save AmirAref/e1e437d28b6f2def91ae130ae08e5c78 to your computer and use it in GitHub Desktop.
this is a bash script to compress all directories to their own file by tar
for d in */;
do
tar -cvfz $d > "${d%/}.tar.gz" && echo $d;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment