Time zone information is generally required during the installation of Linux when the environment is Desktop. Rarely does the user exchange this information later.
But when it comes to virtual servers and cloud computing environments, it is generally necessary to change the time zone zones of these servers.
The /usr/share/zoneinfo directory contains the configuration information for the time zone zones. The system’s local zone is determined by a symbolic link from some file in this directory to the /etc/localtime file.
It is common in the /usr/share/zoneinfo directory to find subdirectories containing macro regions of the world or countries with several time zones.
$ ls -l /usr/share/zoneinfo/
drwxr-xr-x. 2 root root 4096 Aug 20 2018 Africa
drwxr-xr-x. You are root root 8192 Aug 20 2018 America
drwxr-xr-x. 2 root root 187 Aug 20 2018 Antarctica
drwxr-xr-x. 2 root root 26 Aug 20 2018 Arctic
drwxr-xr-x. 2 root root 4096 Aug 20 2018 Asia
drwxr-xr-x. 2 root root 196 Aug 20 2018 Atlantic
drwxr-xr-x. 2 root root 4096 Aug 20 2018 Australia
drwxr-xr-x. 2 root root 09 Aug 20 2018 Brazil
drwxr-xr-x. 2 root root 136 Aug 20 2018 Canada (...)
And inside each directory are the time zone configuration files:
$ ls -l /usr/share/ZoneInfoBrazil/
-rw-r--r--. 3 root root 634 May 9 2018 Acre
-rw-r--r--. 2 root root 714 May 9 2018 DeNoronha
-rw-r--r--. 2 root root 2002 May 9 2018 East
-rw-r--r--. 2 root root 602 May 9 2018 West
To change the Linux clock to local time, simply create a symbolic link from the chosen zone file to the /etc/localtime file:
$ ln -s /usr/share/zoneInfo/America/Sao_Paulo /etc/localtime
Once this is done, the watch will automatically start complying with the timezone chosen for all users.
Learn much more about Linux in our online course. You can register here. If you already have an account, or want to create one, just log in or create your user here.
Share
The sudo command on Linux executes a given command as if it were another user.…
The ss command on Linux is extremely useful for investigating sockets, providing various information about…
Free Linux command shows the amount of total memory in use and available, as well…
The shell has structures for testing conditions and executing certain program sequences several times (loop),…
The /etc/fstab file stores the configuration of which devices should be mounted and what is…
The Netcat Command in Linux or nc is a utility used to do “almost anything”…
This website uses cookies.