find 綜合應用

find /opt/log/ -name "platform-log-*" -mtime +3 -exec rm {} +orm

在/opt/log/ 目錄中查找3天之前的以platform-log-開頭的文件,並將其刪除掉。
-mtime 修改時間
-ctime 建立時間
+3 當前時間3天之前的全部
-3 當前時間3天之後的全部
3  當前時間到3天之前的區段全部form

相關文章
相關標籤/搜索