restart server ubuntu code example

Example 1: restart apache ubuntu

# Restart Apache 2 server on Linux/Unix
sudo service apache2 restart

# Start Apache 2 server on Linux/Unix
sudo service apache2 start

# Stop Apache 2 server on Linux/Unix
sudo service apache2 stop

Example 2: how to restart the network in ubuntu

$ sudo service network-manager restart

Example 3: restart ubuntu server

Try using the following command to safely reboot:

sudo reboot

If, instead, you want to shut down the server safely, use this command:

sudo shutdown -h now

Example 4: command to restart linux

sudo reboot

Example 5: restart server centos

reboot -h now

Example 6: restart computer command linux

$ sudo shutdown -r now