Linux Find and Locate Cheat Sheet/Delete old temporary files

Remove matching files directly from find.

Section: Actions and locate

Delete old temporary files

bash
bash
find /tmp -type f -name '*.tmp' -delete

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Actions and locate
Run chmod on matched files
Execute a command on each result.
OpenIn sheetbashsame section
Locate files using database
Search quickly using updatedb database.
OpenIn sheetbashsame section
Refresh locate database
Update file index used by locate.
OpenIn sheetbashsame section
Find files larger than 100 MB
Search for large files using size filters.
OpenIn sheetbash2 tag match
Find file by exact name
Search recursively for a specific filename.
OpenIn sheetbash1 tag match
Find world-writable files
Audit overly permissive files.
OpenIn sheetbash1 tag match