Skip to content

Scripts

Reference

Type Runtime
Bash (Windows) Git Bash
UserScript Violentmonkey
DevTools Browser DevTools Console
Node Node.js
Python Python

Zip all folders in working directory

1
2
3
4
5
6
zipdirs () {
    for path in "${1:-$PWD}"/*/; do
        "C:/Program Files/7-Zip/7z.exe" a -r "${path::-1}.zip" "$path" > /dev/null
        [ $? -eq 0 ] && echo "Zipped $path"
    done
}
1
2
3
zipdirs () {
    find ./* -maxdepth 0 -type d -exec zip -0 -r {}.zip {} \;
}


Updated 2022/09/04