date command in Linux means Displaying the system date and time in Linux.

Syntax
date [OPTION]… [+FORMAT]
date [-u|–utc|–universal] [MMDDhhmm[[CC]YY][.ss]]
In the man page, the describes it
- date – print or set the system date and time.
- man date– More details information about date command.
date command in Linux with Examples
$ date

Get year month day
[huupv@huupv devopsroles]$ date +%Y-%m-%d
2019-03-10
Get date command usage in Linux
[huupv@huupv devopsroles]$ date -d now
Sun Mar 10 13:18:55 +07 2019
[huupv@huupv devopsroles]$ date -d tomorrow
Mon Mar 11 13:19:00 +07 2019
[huupv@huupv devopsroles]$ date -d yesterday
Sat Mar 9 13:19:06 +07 2019
[huupv@huupv devopsroles]$ date -d last-sunday
Sun Mar 3 00:00:00 +07 2019
[huupv@huupv devopsroles]$ date +'%Y-%m-%d'
2019-03-10
Conclusion
date command is a simple command in Linux. It is the most popular in use terminal Linux print or set the system date and time. Thank you for reading the DevopsRoles page!
1 thought on “date command in Linux with Examples”