开发者

Recent files in folder

I want to check files which are recently added to the folder in unix environment.

is there any find check

     fi开发者_StackOverflownd -name 'filename' timestamp last 5 mins ??


To locate files modified less than 5 minutes ago

find -name 'filename'  -mmin -5

From the man page:

   -mmin n
          File's data was last modified n minutes ago.

   -mtime n
          File's data was last modified n*24 hours ago.

-mmin is supported under most recent versions of GNU find.


To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories:

find . -mtime -1 -print

Source


In zsh:

ls *(mm-5)   # or 'mh' to detect stuff modified in the last 5 hours etc.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜