Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/18.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
BASH:显示上次修改的文件和修改的日期_Bash - Fatal编程技术网

BASH:显示上次修改的文件和修改的日期

BASH:显示上次修改的文件和修改的日期,bash,Bash,我试图列出过去60分钟内修改过的所有文件。我使用了find,但它只显示路径,而不显示上次修改的日期。我该怎么做 # Missing last modified date find . -mmin -60 -not -path './.git/*' 如果您正在使用GNUfind,请添加-ls操作: find . -mmin -60 -not -path './.git/*' -ls 否则,POSIX可能会: find . -mmin -60 -not -path './.git/*' -exe

我试图列出过去60分钟内修改过的所有文件。我使用了
find
,但它只显示路径,而不显示上次修改的日期。我该怎么做

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

如果您正在使用GNU
find
,请添加
-ls
操作:

find . -mmin -60 -not -path './.git/*' -ls
否则,POSIX可能会:

find . -mmin -60 -not -path './.git/*' -exec ls -l {} +
您也可以使用
stat
而不是
ls
仅获取所需信息:

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

如果您正在使用GNU
find
,请添加
-ls
操作:

find . -mmin -60 -not -path './.git/*' -ls
否则,POSIX可能会:

find . -mmin -60 -not -path './.git/*' -exec ls -l {} +
您也可以使用
stat
而不是
ls
仅获取所需信息:

find . -mmin -60 -not -path './.git/*' -exec stat -c '%y : %n' +
使用GNU查找

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

Mon Jul 25 08:19:42.0000000000 2016     ./file.txt
%t文件的上次修改时间,格式为C`ctime'函数返回的格式

%p文件名

使用GNU查找

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

Mon Jul 25 08:19:42.0000000000 2016     ./file.txt
%t文件的上次修改时间,格式为C`ctime'函数返回的格式

%p文件名