Find old/oldest file from the tmp on Linux

find /tmp/ -type f -mtime +1 -exec rm {} \;

Delete all files having ‘jpg’ as extension within a folder and sub-folder older than 15 days old.

find . -mtime +14 -type f -name “*.jpg” -exec rm -f {} \;

Leave a Reply