User Tools

Site Tools


ubuntu:find:find_and_delete_files_after_a_certain_time

This is an old revision of the document!


Ubuntu - Find - Find and delete files after a certain time

find /path/to/folder -type f -name "<regex-for-file-name>" -mtime +<number-of-days> -exec <bash-command> {} \;

Example usage:

find /var/spool/somedir/someotherdir -type f -name "msg*" -mtime +30 -exec rm {} \;
ubuntu/find/find_and_delete_files_after_a_certain_time.1575029613.txt.gz · Last modified: 2020/07/15 09:30 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki