find /path/to/dir -type f -atime +10 -exec rm {} \; #### use File::Find::Rule; File::Find::Rule->file() # only files ->atime("+10") # that haven't been accessed in 10 days ->exec( sub { unlink( $_[2] ) } ) # delete them ->in('/path/to/dir'); # starting in this path