天天看點

find-xargs 查找删除和拷貝

-mtime: 指定時間檔案内容被修改過

-ctime: 指定時間檔案權限被修改過

-atime: 指定時間檔案被讀取過

删除60天前的檔案

find /var/log -name "log*.gz" -mtime +60 -exec rm -rf {} \ ;

#查找指定範圍的删除

find ./{a,b} -type f -name "*2.txt"|xargs rm -rf {} \;

#cp 查找的檔案

find ./ -type f -name "*2.txt"|xargs -i cp '{}' ./c/

本文轉自cloves 51CTO部落格,原文連結:http://blog.51cto.com/yeqing/1682686

繼續閱讀