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

CommandPurpose
bootctlManage EFI firmware boot settings the boot loader
coredumpctlList and process stored core dumps
hostnamectlShows hostname, system type, hardware architecture, OS and kernel version, and allows hostname and location change
importctlDownload, import, and export disk images via systemd-importd
journalctlShow journal entries
localectlManage system locale and keyboard layout
loginctlControls the systemd login manager and can also be used to query information about users
machinectlIntrospect and control virtual machine and container registry registration manager
resolvectlQuery network name resolution from systemd-resolved, show DNS settings and resolver
run0Acts like sudo and uses the systemd-run multi-call binary
systemctlStart, stop, monitor, and change units
systemd-ac-powerReport if system is connected to external power source (AC)
systemd-analyzeAnalyze and debug system manager, from boot order details up to showing general information
systemd-ask-passwordAsk the user a password, like encryption password of a disk
systemd-catRead information and put this into the systemd journal
systemd-cglsShow Linux control group in a tree
systemd-cgtopMonitor control group usage, similar to top for processes
systemd-confextSystem extension images, which dynamically may extend an existing file path. With systemd-confext the focus is just on /etc directory.
systemd-credsShow, encrypt, or decrypt credentials such as keys, certificates, user account information
systemd-cryptenrollEnroll hardware security tokens and devices into LUKS volumes
systemd-cryptsetupProvides access to encrypted block devices
systemd-deltaShow configuration files that are overridden
systemd-detect-virtDetermine if execution is done from within a virtual machine
systemd-dissectIntrospect and interact with file system OS disk images
systemd-escapeHelper utility to escape or unescape text strings for usage in systemd units
systemd-firstbootPerforms specific actions before or during the first boot of the system
systemd-gpt-auto-generatorUnit generator to automatically discover common paths like /, /home, etc., including partitions
systemd-hwdbManages binary hardware database, a key-value store related to udev
systemd-id128Generate and show UUIDs (id-128 identifiers)
systemd-inhibitProvides a lock to prevent events like a system sleep or shutdown to stop execution of an important process
systemd-machine-id-setupInitialize /etc/machine-id file, so a machine ID stored
systemd-mountCreate or start a mount or automount unit
systemd-notifyNotify service manager about daemon status changes
systemd-networkdSystem service to manage network connectivity
systemd-nspawnRun a command or OS in a light-weight container
systemd-pathQuery system and user paths
systemd-repartAutomatically create and grow partitions
systemd-resolveInterface to systemd-resolved to provide network name resolution for local applications
systemd-runRun command within some types of unit files and active the related service
systemd-socket-activeTool to test socket activation of daemons
systemd-stdio-bridgeProxy between STDIN/STDOUT and a bus within D-Bus
systemd-sysextActivates system extension images to dynamically extend existing file paths
systemd-sysusersAllocation of system users and groups
systemd-tmpfilesDeals with temporary files, such as its creation and deletion
systemd-tty-ask-password-agentList or process queued systemd password requests
systemd-umountUnmount utility for specific unit files
systemd-vpickImplementation of vpick protocol for versioned files using Linux UAPI version format specification
systemd-vmspawnSimilar to systemd-nspawn but launches a full virtual machine instead

Missing a particular command? Let it know!