2016-07-25 79 views
0

我试图列出在过去60分钟内修改过的任何文件。我使用find,但它只显示路径而不显示上次修改的日期。我该怎么做呢?BASH:显示修改日期的最后修改文件

# Missing last modified date 
find . -mmin -60 -not -path './.git/*' 

回答

2

如果您正在使用GNU find,添加-ls行动:

find . -mmin -60 -not -path './.git/*' -ls 

否则,POSIX-LY:

find . -mmin -60 -not -path './.git/*' -exec ls -l {} + 

您还可以使用的stat代替ls只得到所需信息:

find . -mmin -60 -not -path './.git/*' -exec stat -c '%y : %n' + 
4

随着GNU发现由C函数`ctime”返回的格式

find . -mmin -60 ! -path './.git/*' -printf '%t\t%p\n' 

Mon Jul 25 08:19:42.0000000000 2016  ./file.txt 

%T文件的最后修改时间。

%p文件名。