Linux 昨天修改的文件夹的所有文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10730199/
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
Linux all files of folder modified yesterday
提问by Pawan
I have modified some files present in various folders in my webroot. This was development environment. Now I have to find all files modified yesterday to migrate to productions.
我修改了 webroot 中各种文件夹中的一些文件。这是开发环境。现在我必须找到昨天修改的所有文件才能迁移到作品中。
Is there any way (Linux command) to list only those files modified yesterday in my webroot tree?
有没有办法(Linux 命令)只列出昨天在我的 webroot 树中修改的那些文件?
采纳答案by mega.venik
find ./ -mtime -1
find ./ -mtime -1
Finds everything, what was modified in the current directory at the last 24 hours.
查找所有内容,即过去 24 小时内当前目录中修改的内容。
回答by Paul Tomblin
find . -mtime +2 -prune -o -mtime +1 -print
This does a find but excludes anything that was modified more than two days ago, then finds anything that was modified more than one day ago.
这会进行查找,但排除两天前修改过的任何内容,然后查找一天前修改过的任何内容。
回答by guest
find . -daystart -mtime 1 -print
This gets just files modified YESTERDAY - ie: today is Jun 21, only files for Jun 20 are found.
这只会在昨天修改文件 - 即:今天是 6 月 21 日,只找到了 6 月 20 日的文件。
(-mtime takes a '-', a '+', or an explicit number of exact days).
(-mtime 使用“-”、“+”或明确的确切天数)。
If you want a long listing, substitute
如果您想要长列表,请替换
-exec ls -ld \;
for the
为了
-print.