Notes‎ > ‎

Find

Find file by extension and delete
$ find . -name "*.gz" -delete

Find file older than 30 days and by more than one extension and delete
$ find . -type f -mtime +30 \( -name '*.tgz' -o -name '*.gz' -o name '*.tmp' \) -exec rm -f {} \;
Comments