nerdexam
LPI

102-500 · Question #140

Which command will set the local machine's timezone to UTC?

The correct answer is B. ln -s /usr/share/zoneinfo/UTC /etc/localtime. Option B works because /etc/localtime is the file Linux reads to determine the system timezone, and symlinking it to the appropriate entry in /usr/share/zoneinfo/ is the standard, persistent way to configure it - the symlink survives reboots and is recognized by virtually all…

Administrative Tasks

Question

Which command 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

(26 responses)
  • A
    4% (1)
  • B
    77% (20)
  • C
    15% (4)
  • D
    4% (1)

Explanation

Option B works because /etc/localtime is the file Linux reads to determine the system timezone, and symlinking it to the appropriate entry in /usr/share/zoneinfo/ is the standard, persistent way to configure it - the symlink survives reboots and is recognized by virtually all Linux distributions.

Why the distractors fail:

  • A (cat UTC > /etc/timezone) - /etc/timezone stores a timezone name string on Debian-based systems, but you'd echo "UTC" > /etc/timezone, not cat a nonexistent file; this command would error or produce garbage.
  • C (date --timezone=UTC) - date has no --timezone flag; it displays or sets the clock time, not the system timezone, and any change would be session-scoped at best.
  • D (mv /usr/timezone/UTC /etc) - that path doesn't exist, and moving a zoneinfo file rather than symlinking it would break the source, not configure the system.

Memory tip: Think "Localtime Needs a Symlink" - ln -s points /etc/localtime at the right zone file, just like pointing a clock hand at the correct time zone on a map.

Topics

#timezone configuration#symbolic links#system administration#/etc/localtime

Community Discussion

No community discussion yet for this question.

Full 102-500 Practice