/ Published in: Bash
A one-liner to remove any temporary files modified over one day ago. Removes files from /tmp/ Run without the '-exec rm {} \;' part to check that it is matching the right set of files - this can be dangerous if run by root! If you want to remove files modified today, change +1 to -1 This can be useful to add into crontab though
Expand |
Embed | Plain Text
find /tmp/ -type f -mtime +1 -exec rm {} \;
You need to login to post a comment.
