Date configuration

In most Linux environments, it's critical to have the systems synchronized with the correct time. We can expose the current date using the date command. We can view the system date and time by simply running the following command:

root@philip-virtual-machine:/home/philip# dateThu Sep  6 16:25:56 EDT 2018root@philip-virtual-machine:/home/philip#

Based on the preceding output, we can see the current date. It is also possible to set the date and time using the date command. To be able to specify the date in string format, we pass the -s option:

philip@philip-virtual-machine:~$ date -s "19 Dec 2020 12:00:00"date: cannot set date: Operation not permittedSat Dec 19 12:00:00 EST 2020philip@philip-virtual-machine:~$

Based on the ...

Get CompTIA Linux+ Certification Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.