Basic Linux Service Commands

Basic Linux Service Commands

This tutorial goes through basic Linux service commands including starting, stopping, reloading, restarting, disabling, enabling, and checking status of services on a Linux machine.

Starting Services

For most services on a Linux machine, you can start them via simply entering: 

							
							
					sudo systemctl start <service_name> # or
sudo service <service_name> start				
			

Stopping Services

The same goes for stopping, just replace start with stop as so:

							
							
					sudo systemctl stop <service_name> # or
sudo service <service_name> stop				
			

Reloading & Restarting Services

And likewise for reloading and restarting services:

							
							
					sudo systemctl restart <service_name> # or
sudo service <service_name> restart

# for reloading it would be 

sudo systemctl reload <service_name> # or
sudo service <service_name> reload

# restarting services stops the service entirely while reloading simply reloads conf files without breaking existing connections				
			

Enabling & Disabling Services

By now you get the idea:

							
							
					sudo systemctl enable <service_name> # or
sudo service <service_name> enable

# for disabling it would be 

sudo systemctl disable <service_name> # or
sudo service <service_name> disable
				
			

Checking Status

Likewise:

							
							
					sudo systemctl status <service_name> # or
sudo service <service_name> status				
			

Walter Miely is a tech entrepreneur and CEO of Phoenix Ignited Tech You can find him on Linkedin. This material is licensed under the CC BY 4.0 License LEGAL DISCLAIMER: The content provided here is provided AS IS, and part of, or the entirety of this content may be incorrect. Please read the entireLegal Disclaimer here.