Re: [接龍] BSD 小技巧分享
※ 引述《concore.bbs@ptt.cc ( )》之銘言:
> ※ 引述《dingyuchi (fish)》之銘言:
> : #刪除90天前建立的檔案
> : find ./ -mtime +90 -maxdepth 1 | xargs rm -rf
> 改用
> find ./ -mtime +90 -maxdepth 1 -exec rm -rf {} \;
> 會不會比較好?!
在 FreeBSD 下可以用 -delete,比較省資源。
-delete
Delete found files and/or directories. Always returns true.
This executes from the current working directory as find recurses
down the tree. It will not attempt to delete a filename with a
``/'' character in its pathname relative to ``.'' for security
reasons. Depth-first traversal processing is implied by this
option.
--
Resistance is futile.
http://blog.gslin.org/ & <gslin@gslin.org>
--
※ Origin: 邪惡小鹿鹿 <Deer.twbbs.org> ◆ From: 140.113.17.29
討論串 (同標題文章)
完整討論串 (本文為第 17 之 26 篇):