↑ ↓ select, Enter open, Esc close

systemd

Start, stop, enable and debug services. Plus systemd timers as an alternative to cron and targeted journal queries.

16 one-liners: 10 harmless, 5 caution, 1 destructive

All systemd one-liners

Analyze boot time and find slow services

$systemd-analyze && systemd-analyze blame --no-pager | head -20
harmless

Change service settings with an override

#systemctl edit mariadb
caution

Enable a service and start it immediately

#systemctl enable --now fail2ban
caution

List all running systemd services

$systemctl list-units --type=service --state=running --no-pager
harmless

List all services enabled at boot

$systemctl list-unit-files --type=service --state=enabled --no-pager
harmless

Permanently limit the size of the systemd journal

#mkdir -p /etc/systemd/journald.conf.d && printf '[Journal]\nSystemMaxUse=500M\n' > /etc/systemd/journald.conf.d/size.conf && systemctl restart systemd-journald
caution

For the websites on your server

Free SEO and PageSpeed check

GENLOC.SEO analyzes any domain for load time, Core Web Vitals and on-page issues and tells you in plain words what is going on. Available in 11 languages.

by GENLOC.NETWORK, the team behind myline.de

Query uptime, memory and restart count of a service

$systemctl show php8.2-fpm -p ActiveState,ActiveEnterTimestamp,MainPID,MemoryCurrent,NRestarts
harmless

Restart a service and check the result

#systemctl restart php8.2-fpm && systemctl is-active php8.2-fpm
caution

Show a service's unit file including overrides

$systemctl cat mariadb
harmless

Show all failed systemd units

$systemctl --failed --no-pager
harmless

Show all systemd timers with next run time

$systemctl list-timers --all --no-pager
harmless

Show disk space used by the systemd journal

#journalctl --disk-usage
harmless

Show the dependencies of a systemd unit

$systemctl list-dependencies apache2 --no-pager
harmless

Show the full status of a systemd service

$systemctl status nginx --no-pager -l
harmless

Shrink the systemd journal to a maximum size

#journalctl --vacuum-size=500M
destructive

Stop a service and disable autostart

#systemctl disable --now cups
caution

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.