开发者

How to list last changed files in one directory

开发者 https://www.devze.com 2023-01-15 02:31 出处:网络
if anyone hacks a site, then I would like to check which files are changed maybe in the last 24 hours in the directory htdocs, that means the files in the subdirectories form htdocs too. How to do thi

if anyone hacks a site, then I would like to check which files are changed maybe in the last 24 hours in the directory htdocs, that means the files in the subdirectories form htdocs too. How to do this?

I will be happy 开发者_StackOverflowfor any suggestions,

Cheers Nik


find {dir} -mtime -1 -print

will find files modified in the last 24 hours (-1 = 1 day)

If you're using zsh, then you can do:

ls **/*(mh-24)

which shows you files modified in the last 24 hours (you can specify different params for minutes/hours etc. and whether you want modified/accessed etc.)

0

精彩评论

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