compare file timestamp in bash
- by endroix
How do I compare the timestamp of two files?
I tried this but it doesn't work:
file1time=`stat -c %Y fil1.txt`
file2time=`stat -c %Y file2.txt`
if[$file1time -gt $file2time];
then
doSomething
fi
Thanks