find php extension files 命令查询 putty

find php extension files command query putty

我只能在上传目录下找到扩展名为 .php 的文件。

这很简单。我只是去做 cd uploadsfind . -name '*.php'。这适用于每个目录。

有没有办法在所有网站文件夹下的上传目录下找到相同的文件。

我的网站在/var/www/html/webfiles/下,webfiles下都是WordPress网站。所以每个网站都包含 uploads 文件夹。

如何一次为 /var/www/html/webfiles/

下的所有网站查找 .PHP 个扩展文件

请指导。

有了 grep,您可以使用正则表达式来查找与特定模式匹配的文件。

$ find . -print | grep -i uploads\/.*\.php

以上将查找不区分大小写 (-i) 且具有 uploads/*.php.

模式的字符串

More examples