In this section, we will explore some useful tips and tricks for Ubuntu Server. These are general tips related to the command-line interface (CLI), package management, and the customization of configurations.
The following are some useful CLI commands:
Get the reason behind installing a package, that is, check the reverse dependencies of the given package, by using the following command:
apt-cache rdepends --installed [package_name] apt-cache rdepends --installed mysql-server
List all the users along with their respective last login time by executing the following command:
lastlog
To change the server time zone, you need to run the following code:
sudo dpkg-reconfigure tzdata
Furthermore, to check whether the
timezone
has changed or not, you need to run the following command:less /etc/timezone
Also, don't forget to restart
cron
so that it can pick up thetimezone
change, as follows:sudo service cron restart
If you need to manually synchronize...