LFCS · Question #47
Which of the following tasks can be accomplished using the command date? (Choose TWO correct answers.)
The correct answer is B. Output date and time in different formats. C. Set the system clock. The date command in Linux allows users to both display the current system date and time in various formats and manually set the system clock. It provides flexibility for managing the system's time.
Question
Options
- ASynchronize the hardware and system clocks.
- BOutput date and time in different formats.
- CSet the system clock.
- DSet the hardware clock.
- EUpdate the time via NTP.
How the community answered
(20 responses)- A5% (1)
- B95% (19)
Why each option
The `date` command in Linux allows users to both display the current system date and time in various formats and manually set the system clock. It provides flexibility for managing the system's time.
The `date` command itself does not synchronize the hardware and system clocks; this is typically done using `hwclock`.
The `date` command, with various formatting options (e.g., `date +%Y-%m-%d`), can output the current system date and time in a multitude of user-defined formats.
The `date` command can be used to set the system clock manually (e.g., `date --set="YYYY-MM-DD HH:MM:SS"`), requiring appropriate privileges.
While `date` sets the system clock, the `hwclock` command is specifically used to manage the hardware clock; `date` does not directly set the hardware clock.
Updating the time via NTP (Network Time Protocol) is handled by NTP client daemons (e.g., `ntpd`, `chronyd`), not the `date` command.
Concept tested: `date` command usage
Source: https://man7.org/linux/man-pages/man1/date.1.html
Topics
Community Discussion
No community discussion yet for this question.