date command in *NIX

How to get yesterday / past / future dates in *NIX

Ref

http://www.cyberciti.biz/tips/linux-unix-get-yesterdays-tomorrows-date.html

Get yesterday date

1)

YESTERDAY=`TZ=aaa24 date +%Y%m%d`

echo $YESTERDAY


2)

in GNU date:

date --date=yesterday

No comments:

Books I like

  • Inside C++ Object Model
  • Unix Network Programming - Stevens
  • Professional-c++-programmer-to-programmer - wrox
  • Beautiful-code-leading-programmers-explain-how-they-think-theory-in-practice