dsfovbm931034814 2014-10-10 11:43
浏览 187
已采纳

Bash:在不同文件夹中搜索具有相同名称的文件并执行它们

I'm trying to run every wp-cron.php included in my /var/www/ subdirs. I have multiple websites inside /var/www/, so I tried doing something like this:

find /var/www/ -ipath */wp-cron.php -exec php -q "{}" \;

But other files are executed, not related to wp-cron.php. What's wrong with the command above?

  • 写回答

1条回答 默认 最新

  • dqyhj2014 2014-10-10 11:45
    关注

    Correct find command to find wp-corn.php is to use -iname or -name option:

    find /var/www/ -iname 'wp-cron.php' -exec php -q "{}" \;
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?