Content added Content deleted
imported>DrOwl (added hint) |
No edit summary |
||
Line 1: | Line 1: | ||
<man>find</man> |
<man>find</man> |
||
Line 18: | Line 20: | ||
find / -name file '''2> /dev/null''' |
find / -name file '''2> /dev/null''' |
||
/dir/file |
/dir/file |
||
EXAMPLE : find /var/log/ -name "20*-*-*_*.log*" -mtime +80 -exec rm {} \; |
|||
deletes all files older than 80 days |
Revision as of 12:22, 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