2014-12-30 57 views

回答

3

按照手冊頁:

-mtime n 
    File’s data was last modified n*24 hours ago. See the comments 
    for -atime to understand how rounding affects the interpretation 
    of file modification times. 

-mtime該參數被解釋爲整個天數文件的年齡。 -mtime +n表示嚴格大於,-mtime -n表示嚴格小於。

你的情況

所以,

-4這意味着不到4天。
+4意味着超過4天即4 * 24小時。

+0

謝謝!我得到了我的答案! – Unixbun

+0

不客氣。很高興幫助。 – SMA

3

嗯,我可以。

-mtime n 

文件數據的最近一次修改是在n * 24小時前。查看評論爲-atime瞭解四捨五入如何影響文件的解釋修改時間

find . -mtime 0 # find files modified between now and 1 day ago 
        # (i.e., within the past 24 hours) 
find . -mtime -1 # find files modified less than 1 day ago 
        # (i.e., within the past 24 hours, as before) 
find . -mtime 1 # find files modified between 24 and 48 hours ago 
find . -mtime +1 # find files modified more than 48 hours ago 
+0

感謝您的解決方案!但我知道這件事。我想知道如果我給出任何負面價值,那麼這意味着什麼? – Unixbun

+0

不!我用 - 找到。 -mtime -4&find。 -mtime +4。他們給出了不同的結果。 – Unixbun

+0

經過這麼長時間之後,你是絕對正確的,對不起和thx糾正我。 – wgitscht