Posted By

noah on 09/21/10


Tagged

time delete rm log grep FileSystem find sysadmin one-liners logfile roll ctime mtime atime rolling sysop


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

smvnet


delete files older than 1 day


 / Published in: Bash
 

URL: http://linux.die.net/man/1/find

Finds and removes files older than 2 days.\r\n\r\nUse with caution obviously, as if you fuck up, you\'ll certainly delete files you want to keep, possibly destroying your entire computer.\r\n\r\nEnjoy!

  1. # delete ANY FILE created more than 1 day ago
  2.  
  3. find -mtime +1 -exec rm {} \;

Report this snippet  

You need to login to post a comment.