Linux 有没有办法在整个项目代码中找出某个日期后更改的文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8985989/
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
Is there any way to find out changed file after some date in whole project code?
提问by Jeegar Patel
see i am working in one BIG project source code Now i want to know which files are modified after some date.
看到我正在处理一个大项目源代码 现在我想知道在某个日期之后修改了哪些文件。
Is there any command or any way to get that..
有什么命令或任何方法可以得到那个..
i have tried
我试过了
# ls -R -l
but here it shows all file with last modified data but i want to filter this output by some data ...
但在这里它显示了所有带有最后修改数据的文件,但我想通过一些数据过滤这个输出......
so is there any way to do this in linux? is there any tool available for this?
那么有没有办法在linux中做到这一点?有没有可用的工具?
采纳答案by peko
#set timestamp for file
touch --date "2011-12-31" /tmp/foo
# Find files newer than 2011/Dec/31, in /some/files
find /some/files -newer /tmp/foo
回答by Jayan
Use findcommand with mtimearguments: Some examples are hereor here
使用带有mtime参数的find命令: 一些示例在此处或此处
For example, list files changed in last 7 days...
例如,列出过去 7 天内更改的文件...
find / -type f -mtime -7
For finegrained search you may try -mmin argument. See an example discussed in another SE site: Find All files older than x minutes
对于精细粒度搜索,你可以尝试-mmin参数。请参阅另一个 SE 站点中讨论的示例:查找所有超过 x 分钟的文件