Print date in the format <full month name>-<day of month>-<year>, for example "March-16-2019"

date +"%B-%d-%Y"

March 16, 2019Julien_Tremblay_McLellan

Explanation

date +FORMAT prints the current date in the format specified by the format string FORMAT.

The formatting symbols used in the example:

  • %B: the locale's full month name, for example "March"
  • %d: the day of the month, padded with a zero when it's a single digit, so the 1st of the month becomes "01", while the 21st of the month is simply "21"
  • %Y: simply the year, for example "2019"
  • -: this is not a special symbol, it is simply printed literally, so "-"

See man date for the complete list of supported formatting symbols.