【问题标题】:How do I locate and perform a command on all executable files matching a given pattern?如何在与给定模式匹配的所有可执行文件上找到并执行命令?
【发布时间】:2015-07-07 12:11:51
【问题描述】:

如何识别我的 Unix (OS X) 系统上与特定模式匹配且已设置可执行位的所有文件,以便我可以对它们执行命令?

例如,我想找到在给定日期之前创建的所有 .doc 文件,这些文件设置了 have any executable 位,以及 chmod a-x 它们。

【问题讨论】:

    标签: security find file-permissions


    【解决方案1】:

    类似

    find . -name '*.doc' -perm +0111 -exec chmod a-x ''{}'' ";"
    

    这将取决于您所说的“可执行文件”是什么意思。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-13
      • 1970-01-01
      • 2019-05-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多