102-500 · Question #62
What is true about the file /etc/localtime?
The correct answer is E. It is either a symlink to or a copy of a timezone information file such as /usr/share/zoneinfo/. /etc/localtime is a binary timezone data file (in TZif format) that the system uses to determine the local timezone offset and DST rules. It works by being either a direct copy of, or a symbolic link pointing to, a compiled timezone file under /usr/share/zoneinfo/ (e.g…
Question
Options
- AIt is a plain text file containing a string such as Europe/Berlin
- BIt is created and maintained by the NTP service based on the location of the system's IP address.
- CIt is a symlink to /sys/device/clock/ltime and always contains the current local time.
- DAfter changing this file, newtzconfig has to be run to make the changes effective.
- EIt is either a symlink to or a copy of a timezone information file such as /usr/share/zoneinfo/ .
How the community answered
(34 responses)- A6% (2)
- B15% (5)
- C3% (1)
- E76% (26)
Explanation
/etc/localtime is a binary timezone data file (in TZif format) that the system uses to determine the local timezone offset and DST rules. It works by being either a direct copy of, or a symbolic link pointing to, a compiled timezone file under /usr/share/zoneinfo/ (e.g., /usr/share/zoneinfo/Europe/Berlin). You can verify this on any Linux system with ls -la /etc/localtime.
Why the distractors are wrong:
- A - That describes
/etc/timezone(a plain text file used on Debian-based systems), not/etc/localtime. - B - NTP synchronizes the system clock (time), not the timezone. Timezone is set by the administrator, not derived from IP geolocation automatically.
- C -
/sys/device/clock/ltimeis a fabricated path;/etc/localtimestores static timezone rules, not the current time. - D -
newtzconfigdoes not exist as a standard Linux command; no such post-change command is required. Changes to/etc/localtimetake effect immediately for new processes.
Memory tip: Think of /etc/localtime as a snapshot of a timezone rulebook - it's either borrowed (symlink) or photocopied (copy) from the /usr/share/zoneinfo/ library. Tools like timedatectl set-timezone simply update that symlink.
Topics
Community Discussion
No community discussion yet for this question.