ubuntu restart server code example

Example 1: ubuntu 14 apache2 graceful restart

# 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

# Reload Apache 2 server on Linux/Unix "No downtime!"
sudo service apache2 reload

Example 2: 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 3: restart terminal command line ubuntu

#To reset Terminal:
$ reset

#To rerun/restart your bash.rc
$ source ~/.bashrc 

#To Restart your computer
$ reboot

Example 4: centos reboot

shutdown -r now