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?
Click on the arrows to vote for the correct answer
A. B. C. D.C.
https://www.thegeekstuff.com/2010/09/change-timezone-in-linux/The correct answer is C. export TZ=America/New_York.
Explanation:
The /etc/timezone file stores the current timezone settings for the system. In order to temporarily change the timezone from California to New York, we need to set the TZ environment variable to America/New_York.
The export command is used to set environment variables in Linux. Therefore, the correct command to change the timezone to America/New_York temporarily is:
javascriptexport TZ=America/New_York
This command will set the TZ environment variable to America/New_York, which will override the current timezone settings for the system.
Option A is incorrect because the sed command is used for editing files, not setting environment variables.
Option B is incorrect because the cat command is used to display the contents of a file, not set environment variables.
Option D is incorrect because the printf command is used for formatting and printing output, not setting environment variables.