Ubuntu Commands

Common commands for Ubuntu server

To check the time:
date

To list the available time zones:
timedatectl list-timezones

To set the time zone with timedatectl set-timezone:
timedatectl set-timezone America/New_York

You can query the status of timesyncd by running timedatectl with no arguments. You don’t need to use sudo in this case:
timedatectl

If time sync isn’t enabled, turn it on with timedatectl:

sudo timedatectl set-ntp on

You may run: dpkg-reconfigure tzdata if you wish to change the timezone

To check if web service is running:
sudo systemctl status apache2.service

If support or docs service stop working, you can try restarting:

sudo systemctl restart apache2
or
sudo service apache2 restart