dateIf you just type
date
you get the whole date:
Mon Feb 12 15:31:07 PST 2007
However, you can set the format of the output with the % fields on pages 655-656 of the book. Let’s say you want the month, day, and year separated by slashes:
date '+%m/%d/%y'
produces:
02/12/07
Or, if you are in Europe, you want the full year, a space, the month, a space, and the day:
date '+%Y %m %d'
which produces
2007 02 12
What if you don’t want the leading zero on the "02" for the month? You use a minus sign after the %:
date '+%Y %-m %d'
produces
2007 2 12