ProdigYu's Blog

Archive for February, 2012

Find命令简单使用说明

by ProdigYu on Feb.09, 2012, under Linux

1)3天内修改过的文件:

find -ctime -3

2)find命令使用超过6天,空文件独立查询命令。

find /data/backup -ctime +6 -exec rm -f {} \;   删除/data/backup目录下修改时间超过6天的文件。
find /data/backup -type d -empty -exec rmdir {} \; >/dev/null 2>&1  删除/data/backup目录下空的文件夹,同时输出正确和错误信息到空。

(continue reading…)

Leave a Comment :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...