Content added Content deleted
No edit summary |
No edit summary |
||
Line 1:
<man>find</man>
Line 21 ⟶ 19:
/dir/file
<pre>
EXAMPLE : find /var/log/ -name "20*-*-*_*.log*" -mtime +80 -exec rm {} \;
deletes all files older than 80 days
</pre>
|
Revision as of 12:23, 23 April 2008
<man>find</man>
Tips
If you want to suppress error messages such as
find / -name file find: cannot read dir /lost+found: Permission denied /dir/file
as these messages are written to errout and not stdout, a nice trick is to pipe errout to null
find / -name file 2> /dev/null /dir/file
EXAMPLE : find /var/log/ -name "20*-*-*_*.log*" -mtime +80 -exec rm {} \; deletes all files older than 80 days