systemctl Common Commands
Service Management
| Command | Description |
|---|---|
sudo systemctl start service-name | Start a service |
sudo systemctl stop service-name | Stop a service |
sudo systemctl restart service-name | Restart a service |
sudo systemctl reload service-name | Reload configuration (without restarting) |
systemctl status service-name | Check service status |
Boot Startup
| Command | Description |
|---|---|
sudo systemctl enable service-name | Enable auto-start at boot |
sudo systemctl disable service-name | Disable auto-start at boot |
sudo systemctl enable --now service-name | Enable auto-start and start immediately |
systemctl is-enabled service-name | Check if auto-start is enabled |
systemctl is-active service-name | Check if currently running |
List Services
| Command | Description |
|---|---|
systemctl list-units --type=service --state=running | List all running services |
systemctl list-units --type=service --all | List all services (including inactive) |
systemctl list-unit-files --type=service --state=enabled | List all boot-enabled services |
systemctl list-units --failed | List failed services |
User-level Services
| Command | Description |
|---|---|
systemctl --user start service-name | Start a user-level service |
systemctl --user stop service-name | Stop a user-level service |
systemctl --user status service-name | Check user-level service status |
systemctl --user enable service-name | Enable user-level service auto-start |
systemctl --user list-units --type=service | List user-level services |
Common user-level services: pipewire, pipewire-pulse, wireplumber
System Power Management
| Command | Description |
|---|---|
systemctl poweroff | Power off |
systemctl reboot | Reboot |
systemctl suspend | Suspend |
systemctl hibernate | Hibernate |
systemctl hybrid-sleep | Hybrid sleep |
View Service Details
| Command | Description |
|---|---|
systemctl show service-name -p FragmentPath | Show service configuration file path |
systemctl cat service-name | Show full service configuration |
systemctl show service-name | Show all service properties |
systemctl list-dependencies service-name | Show service dependency tree |
Modify Service Configuration
| Command | Description |
|---|---|
sudo systemctl edit service-name | Create or edit override configuration |
sudo systemctl daemon-reload | Reload configuration after changes |
sudo systemctl restart service-name | Restart service to apply changes |
The override file is located at /etc/systemd/system/service-name.service.d/override.conf. Do not directly edit files in /lib/systemd/system/.
Timers
| Command | Description |
|---|---|
systemctl list-timers --all | List all timers |
systemctl status timer-name.timer | Check timer status |
sudo systemctl enable --now timer-name.timer | Enable a timer |
sudo systemctl disable timer-name.timer | Disable a timer |
Log Related
| Command | Description |
|---|---|
journalctl -u service-name | View service logs |
journalctl -u service-name -f | Follow service logs in real time |
journalctl -u service-name -b | View service logs since current boot |
Targets (Run Levels)
| Target | Description |
|---|---|
graphical.target | Graphical interface (default) |
multi-user.target | Multi-user command line |
rescue.target | Rescue mode |
emergency.target | Emergency mode |
| Command | Description |
|---|---|
systemctl get-default | Check current target |
sudo systemctl set-default multi-user.target | Boot to command line |
sudo systemctl set-default graphical.target | Boot to graphical interface |
sudo systemctl isolate multi-user.target | Temporarily switch target |
Useful Tips
| Command | Description |
|---|---|
sudo systemctl mask service-name | Mask a service (completely prevent starting) |
sudo systemctl unmask service-name | Unmask a service |
systemd-analyze | Check boot time |
systemd-analyze blame | Rank services by boot time |
systemd-analyze critical-chain | Show critical boot chain |
Last updated on