CompTIACompTIA
XK0-005 · Question #1163
XK0-005 Question #1163: Real Exam Question with Answer & Explanation
The correct answer is C: export TZ=America/New_York. To temporarily change the Linux timezone to New York for the current shell session, the administrator should use the export TZ command.
System Management
Question
A Linux administrator looks at the /etc/timezone file and determines the need to change the time zone from California to New York temporarily. Which of the following commands will accomplish this?
Options
- Ased -f TZ=America/New_York
- Bcat TZ=America/New_York
- Cexport TZ=America/New_York
- Dprintf TZ=America/New_York
Explanation
To temporarily change the Linux timezone to New York for the current shell session, the administrator should use the export TZ command.
Common mistakes.
- A.
sedis a stream editor used for text manipulation in files; it cannot directly set environment variables to change the timezone. - B.
catis used to display file content and cannot be used to set environment variables for the current shell. - D.
printfis a command for formatting and printing data; it does not set environment variables for the shell.
Concept tested. Linux timezone environment variable
Reference. https://man7.org/linux/man-pages/man3/tzset.3.html
Topics
#Time Zone Management#Environment Variables#Linux Commands#Shell Configuration
Community Discussion
No community discussion yet for this question.