Debian: Systemd command line examples


simply a collection of systemd command line examples. To be continued……

Set hostname + fqdn


sudo hostnamectl set-hostname




journalctl -b

Default target (in former releases the equivalent to System V Runlevel)

systemctl get-default
systemctl set-default -f

list targets

systemctl list-units --type=target

list all enabled services

systemctl list-unit-files|grep enabled

journalctl -f

Log for specfic service or unit

journalctl -u bind9

Show unit environents

systemctl show named

Analyze Startup order and times

systemd-analyze critical-chain

List all services want by a target in filesystem

ls -l /etc/systemd/system/

Set environment varibales for a service, create a directory .d

mkdir /etc/systemd/system/docker.service.d

Create a file /etc/systemd/system/.d/http-proxy.conf
And add


Show configured environment

systemctl show docker --property Environment

Reload daemons

systemctl daemon-reload

Restart a daemon

systemctl restart docker

Default target: Boot to text console

systemctl set-default

Default target: Boot to graphical desktop

systemctl set-default

Switch from text console to graphical UI

systemctl isolate

Switch to text console

systemctl isolate

Switch to rescue console

systemctl rescue

and to emergency console

systemctl emergency

List all targets

systemctl list-units --type target --all

Advertisment to support

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.