Tuesday, April 17, 2012

date command linux

To display yesterdays date in linux:

date --date="yesterday"

To subtract 1 day from date in linux:

previous_date=`date -d "$(date +%Y-%m-%d) -1 days" +%Y%m%d`

No comments:

Post a Comment