Linux Commands-Date:To find first day or last day of particular month

How to find the first day or last day of a particular month in linux using DATE

First day:
date -d "-$(($(date +%d)-1)) days" +%d-%m-%Y

Last day:
date -d "1 month -$(date +%d) days"  +%d-%m-%Y



Comments