Jeff Bailey
Written by Jeff Bailey
Learning resources, opinions, and facts about technology.

Learn systemctl

Reading Time: 1.5 minutes
Listen to this post

The Basics

The systemctl command on most Linux distributions is used to well, control your system. I’m writing this article to explain the basics of using systemctl. In the past, I’ve used the service command, but it has gone out of style. I’m past due for an update.

Without systemd the systemctl command would not exist. The systemd software suite aims to unify service configuration and behavior across systems. It’s worth noting that people dislike systemd because it enables tight couplings between software packages and systemd.

Primary Use Cases

Invalid Use Cases

  • A depencency required to run your software

I regularly use these commands.

# List all services
sudo systemctl list-units --type service

# List running services
sudo systemctl list-units --type=service --state=running

# List active services
sudo systemctl list-units --type=service --state=active

# Get the status of a service
sudo systemctl status containerd

# Stop a service
sudo systemctl stop containerd

# Start a service
sudo systemctl start containerd

# Restart a service
sudo systemctl restart containerd

# Check if a service is active
systemctl is-enabled containerd

# Disable a service is active
systemctl disable containerd

# Check if ssh is active
sudo systemctl is-active containerd

Learn systemctl – Beyond the Basics