Skip to content

Instantly share code, notes, and snippets.

@sanyamsmulay
Created February 4, 2023 15:57
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 sanyamsmulay/94d871208521375aab0f44690c4a66df to your computer and use it in GitHub Desktop.
Save sanyamsmulay/94d871208521375aab0f44690c4a66df to your computer and use it in GitHub Desktop.
tar all sub-dirs inside a dir
#!/bin/bash
echo "going to tar all dirs, in this path:" `pwd`
## TODO: ignore files,
## TODO: a flag for managing overwrites
for i in *
do
tar -czvf "$i.tar.gz" "$i"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment