Category: Linux

How to get a previous date in bash (linux) 0

How to get a previous date in bash (linux)

Simply put date -d ‘1 day ago’ +’%Y-%m-%d’ # For multiple days date -d ‘7 days ago’ +’%Y-%m-%d’ If you wish to place in a shell script: RMDATE=$(date -d ‘7 days ago’ +’%Y_%m_%d’) will...