linux restart server 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: command to restart linux

sudo reboot

Example 3: restart server centos

reboot -h now

Example 4: restart computer command linux

$ sudo shutdown -r now

Example 5: restart terminal command line ubuntu

#To reset Terminal:
$ reset

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

#To Restart your computer
$ reboot

Example 6: reboot server linux

sudo shutdown –r
or 
sudo reboot

Tags:

Misc Example