Bash script get yesterdays or one day ago's date or date-1

date -d '1 day ago' +"%Y-%m-%d"

2 comments:

Anonymous said...

if we want 2days ago or 17days ago.so what's the script.
Thanks & valuable blog.....

Pawan said...

Thanks for the script, Short and good.