Linux Date Command: Get Current Date

You can use the date command in the Linux system to obtain the current date. Simply type the following command in the terminal:

date

This will display the current date and time, for example:

Thu Oct 14 09:30:00 UTC 2021

If you want to display only the current date, you can use the parameter +%Y-%m-%d as shown below:

date +%Y-%m-%d

This will display the current date in the format of year-month-day, for example:

2021-10-14

In addition to +%Y-%m-%d, the date command also supports other formatting options. You can choose the appropriate format to display the current date according to your own needs.

bannerAds