⚡ 100% In-Browser & Private: Your data never leaves your computer. Powered by Cloudflare Edge CDN.
ProWebTools PRO
Developer & SEO Utilities
25+ Commands

Systemd, Systemctl & Journalctl Commands Cheat Sheet

Production Systemd cheat sheet: systemctl start, stop, reload, boot enable --now, service masking, journalctl -u -f log tailing, and drop-in unit overrides with 1-click copy.

Service Lifecycle (6 commands)

Service Lifecycle
sudo systemctl start <service_name>

Starts a stopped systemd service unit immediately in the background.

PRO TIP Example: sudo systemctl start nginx or sudo systemctl start postgresql.
Service Lifecycle
sudo systemctl stop <service_name>

Gracefully terminates a running service, sending SIGTERM before SIGKILL.

PRO TIP Systemd waits TimeoutStopSec before forcing termination.
Service Lifecycle
sudo systemctl restart <service_name>

Stops and re-starts the service, reloading newly compiled binaries and state.

PRO TIP Use reload instead if service supports zero-downtime config reload without restart.
Service Lifecycle
sudo systemctl reload <service_name>

Instructs the service to re-read its configuration files without dropping connections.

PRO TIP Works on Nginx, Apache, and sshd without resetting active client sockets.
Service Lifecycle
systemctl status <service_name>

Displays active state, PID, memory usage, CPU time, and recent log snippet.

PRO TIP Exit status viewing without paging by passing --no-pager.
Service Lifecycle
systemctl is-active <service_name>

Returns active or inactive. Returns shell exit code 0 if service is running.

PRO TIP Extremely clean for shell scripts: systemctl is-active --quiet nginx && echo "OK".

Startup & Enablement (5 commands)

Startup & Enablement
sudo systemctl enable <service_name>

Creates a symlink in /etc/systemd/system/multi-user.target.wants/ to launch on boot.

PRO TIP Does not start the service immediately unless --now flag is included.
Startup & Enablement
sudo systemctl enable --now <service_name>

Enables the service to launch on system boot AND starts it immediately.

PRO TIP Combines enable and start into a single atomic sysadmin command.
Startup & Enablement
sudo systemctl disable <service_name>

Removes the boot startup symlink so the service will not launch on restart.

PRO TIP Does not terminate an already running process unless --now is passed.
Startup & Enablement
sudo systemctl mask <service_name>

Links the service unit file to /dev/null, rendering it completely un-startable.

PRO TIP Prevents other services or human admins from accidentally starting it.
Startup & Enablement
sudo systemctl unmask <service_name>

Restores a masked service, allowing it to be started or enabled normally.

PRO TIP Removes the symlink pointing to /dev/null.

Unit Files & Reload (3 commands)

Unit Files & Reload
sudo systemctl daemon-reload

Reloads systemd manager configuration after editing any .service file in /etc.

PRO TIP Mandatory whenever you create, edit, or delete custom unit configuration files.
Unit Files & Reload
systemctl list-units --type=service --state=running

Lists all currently running background services across the entire system.

PRO TIP Use --state=failed to quickly discover crashed or faulty daemon units.
Unit Files & Reload
sudo systemctl edit <service_name>

Creates a drop-in override file (override.conf) to modify parameters safely.

PRO TIP Overrides avoid altering packaged files in /lib/systemd/system/ directly.

Journalctl Logs (5 commands)

Journalctl Logs
journalctl -u <service_name> -f

Tails live logs for a specific service in real-time (similar to tail -f).

PRO TIP Press Ctrl+C to stop following the stream.
Journalctl Logs
journalctl -u <service_name> -n 100 --no-pager

Displays the most recent 100 log lines from the service without opening less.

PRO TIP Ideal for CI/CD deploy verification scripts and automated diagnostic checks.
Journalctl Logs
journalctl -u <service_name> --since "1 hour ago"

Filters log entries generated within the last hour for targeted incident triage.

PRO TIP Supports ISO dates: --since "2026-11-08 00:00:00" --until "2026-11-08 02:00:00".
Journalctl Logs
journalctl -p err -b

Shows all error, critical, and emergency priority logs since the current boot.

PRO TIP Filters out noisy info and debug messages during root cause analysis.
Journalctl Logs
sudo journalctl --vacuum-size=500M

Prunes archived journal logs so total log disk consumption remains under 500MB.

PRO TIP Prevents systemd journal logs from filling small VPS boot partitions.