Monday, January 21, 2013

check how old is the file

Hi,

we often need to check, how old is the file from the current date

$ export  FILE="the-big-file.log" ; echo `date +"%s"` - `stat -c %Z $FILE`|bc


this command gives us the difference in secs; how old is the file (the-big-file.log)