How can I retrieve yesterday date using bash?
$ date '+%A, %Y-%m-%d'
Saturday, 2014-06-28
$ date -d "yesterday" '+%A, %Y-%m-%d'
Friday, 2014-06-27

Customize the above date options within single quotes to get your desired date format:


Free Linux eBooks

Go to top