2023-01-16

How to find files modified last month

Very interesting use of Linux date program, especially parameters to calculate start of last month. It's clever and it works!
find . -type f -name '*.php' -newermt "$(date -d "$(date +%y-%m-1) - 1 month" +%y-%m-%d)"

No comments: