问题
How I identify all files on my Unix (OS X) system matching a particular pattern that have their executable bit set, so that I can perform a command on them?
For example, I'd like to locate all .doc
files created before a given date that have any executable bit set, and chmod a-x
them.
回答1:
Something like
find . -name '*.doc' -perm +0111 -exec chmod a-x ''{}'' ";"
It will depend on exactly what you mean by "executable".
来源:https://stackoverflow.com/questions/29922883/how-do-i-locate-and-perform-a-command-on-all-executable-files-matching-a-given-p