Easy search and archiving of files in Linux

By | March 13, 2009

Say you have a folder full of downloads and you don’t need the files you got prior to the day before yesterday. This command will search for and archive all files bigger than 100Kb and older than 48hrs:

find /path/to/directory/ -type f -mtime -2 -size +100k | xargs tar -zcvf archive.tgz

Category: cli

Leave a Reply

Your email address will not be published. Required fields are marked *