Problem scenario
In Linux you want to delete files that have not been modified in the past three days from the /tmp/ directory. What do you do?
Solution
Run this: find /tmp/ -maxdepth 1 -type f -atime -3 -ls | awk '{print $NF}' | rm -rf
A Technical I.T./DevOps Blog
Problem scenario
In Linux you want to delete files that have not been modified in the past three days from the /tmp/ directory. What do you do?
Solution
Run this: find /tmp/ -maxdepth 1 -type f -atime -3 -ls | awk '{print $NF}' | rm -rf