How do I get the last day of the month in Linux?

How do I get the last day of the month in Linux?
Answer
Start with the current date ( date ) -> 2017-03-06. Set that date to the 1st day of its month ( -v1d ) -> 2017-03-01. Subtract one day from that ( -v-1d) -> 2017-02-28. Format the date ( +%d%b%Y ) -> 28Feb2017.
 

Tìm kiếm

Back
Top