Linux Bash code for yesterday’s date in YYYYMMDD format
$ date --date="yesterday" +"%Y%m%d" 20151128 $ date --date="-1 days" +"%Y%m%d" 20151128
Mac Bash code for yesterday’s date in YYYYMMDD format
$ gdate --date="yesterday" +"%Y%m%d" 20151128 $ gdate --date="-1 days" +"%Y%m%d" 20151128