nerdexam
CompTIA

LX0-104 · Question #234

Which of the following commands will set the local machine's timezone to UTC?

The correct answer is B. ln -s /usr/share/zoneinfo/UTC /etc/localtime. To permanently configure a Linux system's timezone to UTC, a symbolic link should be created from /etc/localtime to the UTC timezone data file.

Administrative Tasks

Question

Which of the following commands will set the local machine's timezone to UTC?

Options

  • Acat UTC > /etc/timezone
  • Bln -s /usr/share/zoneinfo/UTC /etc/localtime
  • Cdate --timezone=UTC
  • Dmv /usr/timezone/UTC /etc

How the community answered

(18 responses)
  • A
    6% (1)
  • B
    89% (16)
  • C
    6% (1)

Why each option

To permanently configure a Linux system's timezone to UTC, a symbolic link should be created from `/etc/localtime` to the `UTC` timezone data file.

Acat UTC > /etc/timezone

While some systems may read `/etc/timezone`, directly writing `UTC` to it is not the universal or most robust method across all Linux distributions and might not update the effective timezone.

Bln -s /usr/share/zoneinfo/UTC /etc/localtimeCorrect

In many Linux distributions, setting the system timezone involves creating a symbolic link from `/etc/localtime` to the desired timezone file, such as `/usr/share/zoneinfo/UTC`, which sets the local time to Coordinated Universal Time.

Cdate --timezone=UTC

`date --timezone=UTC` only displays the current date and time in UTC format; it does not change the system's persistent timezone setting.

Dmv /usr/timezone/UTC /etc

`/usr/timezone` is not a standard directory for timezone files, and moving files to `/etc` in this manner is incorrect for setting the system timezone.

Concept tested: Linux timezone configuration

Source: https://man7.org/linux/man-pages/man5/localtime.5.html

Topics

#timezone#system clock#symlinks#system configuration

Community Discussion

No community discussion yet for this question.

Full LX0-104 Practice