很多時候, 我們可以通過檢視檔案改動時間 (mtime) 來直觀的判斷檔案是否為自己上傳, 從而斷定網站是否曾被黑.
對於站羣服務器管理員, 我們可以通過檢視 mtime 來縮短檢查資料時間.
 
開始我們簡單瞭解下檔案時間:
access time   atime 在讀取檔案或執行檔案時會修改 create time   ctime 在檔案寫入,更改所有者,許可權。連結時檔案的 ctime 會隨之改變 modified time  mtime 在檔案寫入時會改
 
接下來我們該如何去檢查自己資料是否變更:
(1) 使用 find 命令:
查詢在某個時間段之間 (如 20160228—20160301) 的檔案, 可以使用如下命令:
>> find . -newermt ‘20160228’ ! -newermt ‘20160301’
 
找出”3 天以前被改動過的檔案”
>> find . -mtime +3 -type f -print
 
找出”3 天內被改動過的檔案”
>> find . -mtime -3 -type f -print
 
找出” 第三天被改動過的檔案”
>> find . -mtime 3 -type f -print
>> find . -mtime +2 -mtime -4 -type f -print
注: “.” 表示當前目錄
 
(2) 其實最直觀的方式就是進行檔案時間排序
>> cd 相應目錄
>> ls -lrt
-l use a long listing format 以長列表方式顯示(詳細資訊方式)
-t sort by modification time 按修改時間排序(預設最新時間的在最前面)
-r reverse order while sorting (反序)