I have been using the following code for the longest on a system I took over:
find /mnt/tmp -atime +91 -exec rm -f {} \;
However, researching further I see everyone saying the curly braces should be enclosed in single quotes like below:
find /mnt/tmp -atime +91 -exec rm -f '{}' \;
I have never had issues before, but I am curious of any negative impact not using the single quotes might have. Also curious if it varies across linux flavors?
The servers are Ubuntu.
find /mnt/tmp -type f -atime +91 -exec rm -f '{}' \;
find /mnt/tmp -atime +91 -delete
- or use tmpwatch/tmpreaper :)-exec rm -f
forks and exec's one rm per file.-delete
makes find simply unlink the file, that's a lot faster.