Basic System Configuration In Centos/Linux 8
how to change date in linux

Basic System Configuration In Centos/Linux 8

With the help of this article, we will learn how to check hostname, date, time, etc. in Linux operating system and Linux Other Distributions and if the system is showing wrong Day time how change it.

Change Hostname:

In Linux/CentOS Host name can also change at the time of operating system installation as bellow Images.

change hostname during OS Installation

The hostname and time zone of Linux or any other operating system can also be changed at the time of installation .

change  Host Name During OS Installation in Centos/Linux

change the host name after installation.

Hostname is a unique identity in the system. Which you can use online or offline, it is most commonly used for DNS (Domain Name System) and NIS (Network Information System) or to share any data in the network.

You can change the hostname even after installing the operating system in the system, but in this article we will change the hostname after the OS Installation. Temporary change hostname ( when you restart system . it will be back) .

Check the hostname

hostname 

With the below command, we can see the process of changing the hostname with the screenshot. With the help of hostname command in Linux operating system, the hostname of the system can be temporarily changed which is

hostname simi
check Hostname in Centos/Linux 8

Change Permanent host name.

If you want to change the hostname for permanenlyt in the system, the first way is to enter the hostname in the /etc/hostname file and the second option is that you can do it with hostnamectl command.

[root@simitech ~]# vim /etc/hostname

OR

[root@simitech ~]#hostnamectl set-hostname siyaram.kaithal
CHeck host name and system Information in Centos/Linux 8

how to change date in Linux And Time:

The date of the system is very important, whether the system is online or online, if your system is working like a server, then it is very important to update the date and time in it.

If your system does not have graphical mode (GUI) installed, how to set date and time in Linux system with command. Through this article, we will talk about this.

If you think that the date and time is wrong in your server or computer, then below command can be very useful for you to check date and time .

date : if you want to check system date and time in format type date command in terminal

[root@simitech ~]# date

timedatectl : display the current date and time along with detailed information about the configuration of the system and hardware clock, run the timedatectl command with no additional command-line options:

[root@simitech ~]# timedatectl 
           
Check System Date and time inCentos/Linux 8

show system Hardware clock

If you want to display the the system hardware clock , then run the command given below, and the output obtained from it can also be seen in the screenshot.

[root@simitech ~]#hwclock -r
[root@simitech ~]# hwclock --show

Change System date date :

As mentioned in the above command, how you can check the date of the system. If your system is showing wrong date then follow the steps given below to set it. To change the date of the system we use datetimectl set-time command

To set the date, we will use the syntax given below

Where,

  • YYYY: Year (2020)
  • MM: Month (10)
  • dd: date (29)
timedatectl set-time YYYY:MM:SS
[root@simitech ~]# timedatectl set-time 2020:10:29
Change System Date in Centos/Linux 8

Change System time

If the system time is showing wrong then you can change it with the command given below

  • hh: Hour (29)
  • mm: Minute (40)
  • : Second (10)
timedatectl set-time hh:mm:ss
[root@simitech ~]# timedatectl set-time 20:40:10
Change System Date in Centos/Linux 8

Change date and Time in one Command

If both the date and time of your system is showing wrong and you want to correct both with only one command instead of running a separate command to correct the date and another command to correct the time, then you have to follow the steps given below to fix it

  date [MMDDhhmmYY[.ss]]

timedatectl set-time YYYY-MM-DD HH:MM:SS

[root@simitech ~]# date 082912512020.50

Where,

  • MM : To Present Month (08)
  • DD: A two-digit day of the month.(29)
  • hh : An hour (12)
  • mm : A two-digit to Present month.(51)
  • YYYY: A four-digit year.(2020)
  • SS : A second(50)
format of system  to change date and time  In Centos/Linux 8

As you can see in the below screen how we have set this date and time 08-29-2020 12:51:50

change Date and In Linux/Centos8 through Terminal
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [root@simitech ~]# timedatectl set-time '2020-08-29 12:51:50'
change both date and time in centos/Linux 8

Change System Timezone:

When you want to change the system’s time zone following the Bellow command. first you can check the current time zone in the system

[root@simitech ~]# timedatectl
check Timezone In Centos/Linux 8

check All Available time zone

If you want to check all the time zones available in the system, then you can check with the help of below command.

timdatectl list-timezones
List Of Timezone in Centos 8
[root@simitech ~]# timedatectl set-timezone Asia/dubai

If your system’s time zone is showing wrong and you want to fix it, then you run the below command in the system’s terminal. As can be seen in the below screen shot that we have set the time zone of Asia/Dubai.

Change TimeZone In Centos/Linux 8

System locale Setting:

Check and change System Locale and keyboard layout.

localectl: may be used to query and change the system locale and
keyboard layout settings. Execute the following command to show the current locale in the system

check All Available locale in your system in below command Pressing Enter from the keyboard will show next locales.

[root@simitech ~]# localectl                                                                                                                                                                                         [root@simitech ~]# localectl list-locales
Check System Locale In Centos/Linux 8

Change locale :

to change to locale in your system

[root@simitech ~]# localectl set-locale en_AU.utf8
Change System Locale In Centos/Linux 8

Conclusion

In this Tutorials, we learned About how to change date in Linux, change the hostname, and time zone on Linux and Linux Distributions . I hope that you will now be able to change the hostname, date, time, and time zone of your system.

Rate this post

This Post Has One Comment

Comments are closed.