Check Linux System Time: 4 Easy Commands
In a Linux system, you can use the following command to obtain the system time:
- To check the current date and time, simply enter the “date” command.
- The hwclock command: When you input the hwclock command, the system will show the time of the hardware clock.
- Command timedatectl: Upon entering the timedatectl command, the system will provide the current date, time, and time zone information.
- The cat command can be used to retrieve the system time by reading the /proc/driver/rtc file. By entering the command cat /proc/driver/rtc, the system will display the hardware clock time and other related information.
- uptime command: By entering the command uptime -s, the system will display the system’s start time, which allows one to indirectly determine the current system time.
These commands can be selected for use as needed.