Created
February 4, 2021 06:09
-
-
Save emjayoh/5da643677089db2be7fbc66c6ed3d95e to your computer and use it in GitHub Desktop.
[Search/print bash] Print all directories where files satisfy condition
This file contains hidden or 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
| set -o extendedglob | |
| has_useful_entries() | |
| ()(($#)) ${1-$REPLY}/^(#i)(*.tmp|desktop.ini|Thumbs.db|.picasa.ini)(NDoN[1]) | |
| printf '%s\n' **/*(D/F^+has_useful_entries) |
This file contains hidden or 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
| set -o extendedglob # for ^ and (#i) | |
| printf '%s\n' **/*(D/F^e'[()(($#)) $REPLY/^(#i)(*.tmp|desktop.ini|Thumbs.db|.picasa.ini)(ND)]') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment