![]() The ln command is used to create file links, while the -s flag is used to set the link type as symbolic and the -f flag forces the creation, which is required to update an existing link. sudo ln -sf /usr/share/zoneinfo/America/Phoenix To change the timezone, replace the symbolic link with that of the correct timezone file for your server. In the example above, we can see the /etc/localtime file is symbolically linked to the America/Toronto timezone file. ls -la /etc/localtime lrwxr-xr-x 1 root wheel 41 30 Aug 22:12 /etc/localtime -> /var/db/timezone/zoneinfo/America/Toronto To get a basic view of the timezone you can ls the file to it’s symbolic link. This file is actually a symbolic link to a timezone file under /usr/share/zoneinfo. The timezone on a RedHat and CentOS server is stored set by the /etc/localtime file. sudo timedatectl set-timezone America/Phoenix Setting Timezone with Symbolic Link For example, to set the server’s timezone to America/Phoenix, you would run the following command. Once you have the timezone you want to set the system to, you use the timedatectl set-timezone command with the name of the timezone. timedatectl list-timezones | grep America. If you have an idea which timezone you want, you can pipe timedatectl into the grep command. You could browse the list by piping the timedatectl command into the less command. find /home -user randomperson-mtime 6 -iname '. type f -empty Look for an empty file inside the current directory. jpg files in the /home and directories below it. timedatectl list-timezones Africa/Abidjan If you need to know how to find a file in Linux called thisfile.txt, it will look for it in current and sub-directories. You can view a list of supported timezones using the timedatectl list-timezones command. In order to set your timezone you should probably list the available zones. In the example below, we can see the server’s time zone is America/New_York, and the offset is -0400. To get detailed information your CentOS server’s date, time, and timezone you use the timedatectl command. You will also learn how to view this linked file and how to update your timezone by changing the link. The timedatectl command is a relatively new addition to Systemd distributions, and provides a much simpler interface for viewing and adjusting a server’s date and time.ĬentOS and RedHat still use symbolically linked files to set the system’s timezone. In this tutorial, you will learn how to check and set your Timezone in CentOS. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |