some useful find combos (linux)

finding a huge group of files in the current directory older than 30 days and sending them to a gzip’d tar file:
find . -type f -daystart -mtime +30 -name "file*" | tar -c --files-from=- | gzip > file.tar.gz

finding a group of files and deleting them (useful when you can’t do an rm * on a directory because there are a boatload of files in that dir):
find . -exec rm {} \;

helpful, so i thought i’d post them.

-m

Posted in Code/Programming, Geeky Stuff at April 30th, 2008. Trackback URI: trackback

No Responses to “some useful find combos (linux)”

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>