The date command in Linux is used to display the current date and time. It can also format the output in various ways. Here are some common uses:
-
Display Current Date and Time:
date -
Display Current Date and Time in UTC:
date -u -
Format Date and Time:
You can format the output using specific placeholders. For example:date +'%A, %Y-%m-%d, %H:%M'This command will display the date in a format like "Monday, 2023-10-02, 14:30".
The date command is useful for logging, scheduling tasks, and displaying time-related information in scripts.
