Which UNIX command is used to display the current system time and date?
a) time
b) date
c) clock
d) uptime
Answer:
b) date
Explanation:
The date command in UNIX displays the current system date and time. When you type date in the terminal, it outputs the current date and time in a standard format. It also allows for formatting and setting the system date and time using various options.
For example, date +%Y-%m-%d will display the date in “year-month-day” format. You can customize the output to suit your needs, such as for logging or scheduling tasks that require date and time stamps.
The date command is important for time-sensitive operations, such as cron jobs, system logs, or ensuring consistency across networked systems. It’s one of the most frequently used commands in system administration.