In a bash script I want to check if a file has been changed within the last 2 minutes.
I already found out that I can access the date of the last modification with <
I solved the problem this way: get the current date and last modified date of the file (both in unix timestamp format). Subtract the modified date from the current date and divide the result by 60 (to convert it to minutes).
expr $(expr $(date +%s) - $(stat mail1.txt -c %Y)) / 60
Maybe this is not the cleanest solution, but it works great.