Question: how to calculate date in linux?
Answer: In a shell environment/script you can get it with date '+%s' At the time of writing, the current time is 1321358027 . To compare with 2011-11-04 (my birthday), date '+%s' -d 2011-11-04 , yielding 1320361200 . Subtract: expr 1321358027 - 1320361200 gives 996827 seconds, which is expr 996827 / 86400 = 11 days ago.