Bash Date cheatsheet

Today

$ date
Sun Jun 20 15:23:20 CST 2021
$ date +"%Y%m%d"
20210620

N Days Before

# Linux
$ date +%Y%m%d -d "1 day ago"
20210619

# BSD (MacOS)
$ date -j -v-1d +"%Y%m%d"
20210619