Which command will set the local machine’s timezone to UTC?
Which command will set the local machine’s timezone to UTC?
A . cat UTC > /etc/timezone
B . ln -s /usr/share/zoneinfo/UTC /etc/localtime
C . date –timezone=UTC
D . mv /usr/timezone/UTC /etc
Answer: B
Explanation:
The command ln -s /usr/share/zoneinfo/UTC /etc/localtime will create a symbolic link from the file /etc/localtime to the file /usr/share/zoneinfo/UTC, which contains the binary time zone data for the UTC timezone. This will set the system’s timezone to UTC, which is the Coordinated Universal Time, the primary time standard by which the world regulates clocks and time1.
The /etc/localtime file is used by various system programs and libraries to determine the local time according to the configured timezone2. The /usr/share/zoneinfo directory contains the time zone information files for different regions and cities around the world3. The other commands are either invalid or will not change the system’s timezone permanently. The command cat UTC > /etc/timezone will overwrite the /etc/timezone file with the string “UTC”, which is not a valid timezone identifier. The /etc/timezone file is a plain text file that contains the name of the timezone, such as “America/New_York” or "Europe/Paris"4. The command date –timezone=UTC will display the current date and time in UTC, but will not change the system’s timezone setting. The command mv /usr/timezone/UTC /etc will move the file /usr/timezone/UTC to the /etc directory, but this file does not exist by default and has no effect on the system’s timezone configuration.
Reference: 1: Coordinated Universal Time – Wikipedia 2: localtime(5) – Linux manual page 3: tz database – Wikipedia 4: How to Change or Set System Locales in Linux – Tecmint : date(1) – Linux manual page : How do I change my timezone to UTC/GMT? – Ask Ubuntu
Latest 102-500 Dumps Valid Version with 194 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund