nerdexam
CompTIA

LX0-104 · 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 can output the current system date and time in various specified formats and also allows an administrator to set the system clock to a desired date and time. It provides direct control over the system's software clock.

Administrative Tasks

Question

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

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

(30 responses)
  • B
    90% (27)
  • D
    7% (2)
  • E
    3% (1)

Why each option

The `date` command can output the current system date and time in various specified formats and also allows an administrator to set the system clock to a desired date and time. It provides direct control over the system's software clock.

ASynchronize the hardware and system clocks.

The `date` command itself does not synchronize the hardware and system clocks. Tools like `hwclock` are used for that specific task.

BOutput date and time in different formats.Correct

The `date` command supports various format specifiers (e.g., `date +%Y-%m-%d`) allowing users to customize the output of the date and time string. This is a core feature of the command for display purposes.

CSet the system clock.Correct

The `date` command, when run with appropriate arguments (e.g., `date -s 'YYYY-MM-DD HH:MM:SS'`), can be used by a privileged user to manually set the system clock (software clock) to a specific date and time.

DSet the hardware clock.

While `date` sets the system clock, it does not directly set the hardware clock (RTC). `hwclock` is the utility used to read from or write to the hardware clock.

EUpdate the time via NTP.

The `date` command is for displaying or manually setting the system clock; it does not have functionality to automatically update the time via Network Time Protocol (NTP). NTP synchronization is handled by services like `ntpd` or `chronyd`.

Concept tested: date command functionality

Source: https://linux.die.net/man/1/date

Topics

#date command#system clock#time display

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice