Last active
October 4, 2022 08:50
-
-
Save wwwins/ff1f7ebb728a1d65c9cdc73797568e67 to your computer and use it in GitHub Desktop.
Compress all subfolders to separate files
This file contains 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
// without hidden folders | |
for f in $(ls -d */); | |
do | |
echo "zip -r -X ${f:0:-1}.zip $f" | |
done | |
// include hidden folders | |
for f in $(ls -Al | awk -F" " '/^d/ {print $9}'; | |
do | |
echo "zip -r -X $f.zip $f" | |
done | |
// forder name with spaces | |
find * -maxdepth 0 -type d -exec zip -r -X {}.zip {} \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment