Linux systemd Units and Timers Cheat Sheet

Work with timer units, socket activation, path units, transient services, and user services.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all
## Timers
List timers
systemctl list-timers

# Show active timers and next run times.

List all timers
systemctl list-timers --all

# Show all timers including inactive ones.

Show timer status
systemctl status logrotate.timer

# Inspect one timer unit.

Enable and start timer
sudo systemctl enable --now myjob.timer

# Activate a timer and persist it across boots.

Start timer now
sudo systemctl start myjob.timer

# Start a timer without enabling it.

Run the timer's service manually
sudo systemctl start myjob.service

# Start the paired service unit directly.

## Other Unit Types
List socket units
systemctl list-units --type=socket

# Show socket-activated units.

List path units
systemctl list-units --type=path

# Show path-based activation units.

List mount units
systemctl list-units --type=mount

# Show mount units known to systemd.

List targets
systemctl list-units --type=target

# Show active target units.

## User Units and Transient Units
List user units
systemctl --user list-units

# Show units under the user service manager.

Enable user service
systemctl --user enable --now syncthing.service

# Enable and start a per-user service.

Enable linger for user
sudo loginctl enable-linger jon

# Keep user services running without an active login session.

Run a transient service
systemd-run --unit=adhoc-backup --description="Ad hoc backup" /usr/local/bin/backup.sh

# Create and run a one-off transient unit.

Run command in transient scope
systemd-run --scope rsync -av ./src/ /mnt/backup/

# Place an existing process subtree under a systemd scope.

More in Linux systemd Units and Timers

No other published sheets yet.

Recommended next

No recommendations yet.