SSH从某一天找到修改过的文件

Sup*_*nja 2 unix ssh shell terminal

我试图从某一天发现一个修改过的文件.我一直在使用,find . -mtime -2但我需要在上周四和周四再往前走.

我并不熟悉unix命令,所以任何帮助都会很棒.

谢谢

Shi*_*dim 5

如果要查找上周四之后修改的文件,请使用此命令

find . -newermt 'last Thursday'
Run Code Online (Sandbox Code Playgroud)

在上周四之前

find . -type f \
    -not \
    -newermt "2012-12-13 00:00:00" 
Run Code Online (Sandbox Code Playgroud)

只有星期四

find . -type f \
    -newermt "2012-12-13 00:00:00" 
    -not \
    -newermt "2012-12-14 00:00:00" 
Run Code Online (Sandbox Code Playgroud)

上周四是2012-12-13.当您搜索任何修改日期低于星期四的文件时,find它应该是-not newermt '2012-12-13'.当您搜索仅在本周四修改的文件时,其低于周三但高于周四.是的,00:00:00如果你愿意,你可以省略部分.

注意: POSIX find没有-newerXY.它只有-newer.转换-newermt "2012-12-13 00:00:00"使用此.

touch -d "2012-12-13 00:00:00" pointA

find . -type f \
        -not \
        -newer pointA
Run Code Online (Sandbox Code Playgroud)