102-500 practice question 24 of 30

Which of the following tasks can be accomplished using the command date? (Choose TWO correct answers.)

Full set: 233 questions
Answer options
A: Synchronize the hardware and system clocks.
B: Output date and time in different formats. Correct answer
C: Set the system clock. Correct answer
D: Set the hardware clock.
E: Update the time via NTP.
Correct Answer:
B. Output date and time in different formats.; C. Set the system clock.
Explanation

The date command is a standard utility for displaying and setting the system's date and time. Its primary functions include printing the current date and time in a default or user-specified format using the +FORMAT option. Additionally, with superuser privileges, it can set the system clock using the -s or --set flag followed by a date string. It does not interact directly with the hardware clock or NTP services.

Why Incorrect

A. The hwclock command is used to synchronize the hardware clock (RTC) and the system clock, not date.
D. The hwclock command is used to set the hardware clock, which is distinct from the system clock that date manages.
E. Time synchronization via NTP is handled by daemons like ntpd, chronyd, or the command ntpdate, not date.

References

1. GNU Coreutils, date invocation. (2022). "The date command can be used to print the current date and time in a variety of formats, or to set the system's date and time." Section 14.1, date: Print or set system date and time.

2. date(1) — Linux manual page. "Display the current time in the given FORMAT, or set the system date... -s, --set=STRING set time described by STRING".

Scroll to Top