Linux 查找服务器上的所有 htaccess 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1739013/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-03 17:53:47  来源:igfitidea点击:

Find all htaccess files on server

linux.htaccess

提问by bart

I'm looking for a Linux command to go through all the directories on my server and find all .htaccess files. The output would be a list of all those files with full path, creation/modification date and filesize.

我正在寻找一个 Linux 命令来遍历我服务器上的所有目录并找到所有 .htaccess 文件。输出将是所有具有完整路径、创建/修改日期和文件大小的文件的列表。

采纳答案by bluebrother

find / -name ".htaccess" -print

find / -name ".htaccess" -print

Replace /with the root folder you like to start searching, in case you don't want to search the whole file system.

替换/为您喜欢开始搜索的根文件夹,以防您不想搜索整个文件系统。

Wikipedia has an article about find, which also links to its man page.

维基百科有一篇关于find的文章,它也链接到它的手册页。

回答by Dmitry

find -name .htaccess

查找 -name .htaccess

回答by jheddings

It's easy with the findcommand.

使用find命令很容易。

find / -name .htaccess -exec ls -l {} \;

This will print the name, and the file details according to ls -l. Note that this is starting the search under /, which may take a long time. You might want to specify a different folder to search.

这将根据ls -l. 请注意,这是在 下开始搜索/,这可能需要很长时间。您可能希望指定不同的文件夹进行搜索。

回答by ewg

Could be as simple as

可能很简单

ls -l $(locate .htaccess)

if updatedbhas run recently.

如果updatedb最近运行。

回答by Yao Li

Another simple way to achieve:

另一种简单的实现方式:

locate .htaccess

找到.htaccess