Systemd commands
Systemd has a range of commands to interact with the systemd services and functions. Typically daemons will have a ’d’ in their name, such as systemd-networkd, while client tools end with ‘ctl’ (systemctl). Here is an overview of the available commands and their purpose.
Primary commands
Journalctl
Events are stored in a journal, similar to what syslog does. The biggest exception is the way log information is stored and how it is queried. As data is stored in a binary format, the journalctl command can filter out relevant information.
Systemctl
To control systemd units, such as services, the systemctl command is used.
Some functions include:
- Start and stop service or unit
- Show status of a unit
- Show dependencies
Looking for a quick overview how to use? Have a look at these cheat sheets:
Overview of systemd commands
Command | Purpose |
---|---|
bootctl | Manage EFI firmware boot settings the boot loader |
coredumpctl | List and process stored core dumps |
hostnamectl | Shows hostname, system type, hardware architecture, OS and kernel version, and allows hostname and location change |
importctl | Download, import, and export disk images via systemd-importd |
journalctl | Show journal entries |
localectl | Manage system locale and keyboard layout |
loginctl | Controls the systemd login manager and can also be used to query information about users |
machinectl | Introspect and control virtual machine and container registry registration manager |
resolvectl | Query network name resolution from systemd-resolved, show DNS settings and resolver |
run0 | Acts like sudo and uses the systemd-run multi-call binary |
systemctl | Start, stop, monitor, and change units |
systemd-ac-power | Report if system is connected to external power source (AC) |
systemd-analyze | Analyze and debug system manager, from boot order details up to showing general information |
systemd-ask-password | Ask the user a password, like encryption password of a disk |
systemd-cat | Read information and put this into the systemd journal |
systemd-cgls | Show Linux control group in a tree |
systemd-cgtop | Monitor control group usage, similar to top for processes |
systemd-confext | System extension images, which dynamically may extend an existing file path. With systemd-confext the focus is just on /etc directory. |
systemd-creds | Show, encrypt, or decrypt credentials such as keys, certificates, user account information |
systemd-cryptenroll | Enroll hardware security tokens and devices into LUKS volumes |
systemd-cryptsetup | Provides access to encrypted block devices |
systemd-delta | Show configuration files that are overridden |
systemd-detect-virt | Determine if execution is done from within a virtual machine |
systemd-dissect | Introspect and interact with file system OS disk images |
systemd-escape | Helper utility to escape or unescape text strings for usage in systemd units |
systemd-firstboot | Performs specific actions before or during the first boot of the system |
systemd-gpt-auto-generator | Unit generator to automatically discover common paths like /, /home, etc., including partitions |
systemd-hwdb | Manages binary hardware database, a key-value store related to udev |
systemd-id128 | Generate and show UUIDs (id-128 identifiers) |
systemd-inhibit | Provides a lock to prevent events like a system sleep or shutdown to stop execution of an important process |
systemd-machine-id-setup | Initialize /etc/machine-id file, so a machine ID stored |
systemd-mount | Create or start a mount or automount unit |
systemd-notify | Notify service manager about daemon status changes |
systemd-networkd | System service to manage network connectivity |
systemd-nspawn | Run a command or OS in a light-weight container |
systemd-path | Query system and user paths |
systemd-repart | Automatically create and grow partitions |
systemd-resolve | Interface to systemd-resolved to provide network name resolution for local applications |
systemd-run | Run command within some types of unit files and active the related service |
systemd-socket-active | Tool to test socket activation of daemons |
systemd-stdio-bridge | Proxy between STDIN/STDOUT and a bus within D-Bus |
systemd-sysext | Activates system extension images to dynamically extend existing file paths |
systemd-sysusers | Allocation of system users and groups |
systemd-tmpfiles | Deals with temporary files, such as its creation and deletion |
systemd-tty-ask-password-agent | List or process queued systemd password requests |
systemd-umount | Unmount utility for specific unit files |
systemd-vpick | Implementation of vpick protocol for versioned files using Linux UAPI version format specification |
systemd-vmspawn | Similar to systemd-nspawn but launches a full virtual machine instead |
Missing a particular command? Let it know!