System and processes
The date command
Shows the current date and time. With +FORMAT you can extract just the part you need for file names or reports.
Syntax
date [+FORMATO]Most useful options
+%FDate as YYYY-MM-DD+%TTime HH:MM:SS-uShows UTC timeCopy-ready examples
$ dateFull date and time$ date +%FJust the date, ideal for a file nameYou can try them in the browser terminal: it does not touch your computer.
Typical mistakes
- In a +FORMAT the case matters: %m is the month and %M the minutes.
Related commands
FAQ
How do I use the date in a file name?
With date +%F, for example backup-$(date +%F).tar.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course