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

CommandPurposeAvailable since
bootctlManage EFI firmware boot settings for the boot loader198
busctlConnect to D-Bus to query information199
coredumpctlList and process stored core dumps195
homectlCreate, change, remove, inspect home directories245
hostnamectlShows hostname, system type, hardware architecture, OS and kernel version, and allows hostname and location change195
importctlDownload, import, and export disk images via systemd-importd256
journalctlShow systemd journal entries183
kernel-installManage kernel and initrd images on the boot partition198
localectlManage system locale and keyboard layout195
loginctlControls the systemd login manager and can also be used to query information about users183
machinectlIntrospect and control virtual machine and container registry registration manager205
networkctlQuery or modify network links known to systemd-networkd216
oomctlRetrieve information from systemd-oomd service, a userspace OOM killer247
portablectlAttach, detach, or inspect portable service images239
resolvconfConfigure interfaces for systemd-resolved service239
resolvectlQuery network name resolution from systemd-resolved, show DNS settings and resolver239
run0Acts like sudo and uses the systemd-run multi-call binary256
systemctlStart, stop, monitor, and change units
systemd-ac-powerReport if system is connected to external power source (AC)
systemd-activateTest socket activation from the command line to simplify troubleshooting198
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-bootUEFI boot manager
systemd-catRead information and put this into the systemd journal39
systemd-cglsShow Linux control group in a tree
systemd-cgtopMonitor control group usage, similar to top for processes39
systemd-confextUses System Extension Images, to extend an existing file path at runtime, with focus on /etc directory.254
systemd-coredumpProcess core dump and log to journal
systemd-coredumpctlExtract core dumps from the journal195
systemd-credsShow, encrypt, or decrypt credentials such as keys, certificates, user account information250
systemd-cryptenrollEnroll hardware security tokens and devices into LUKS volumes248
systemd-cryptsetupProvides access to encrypted block devices
systemd-deltaShow configuration files that are overridden183
systemd-detect-virtDetermine if execution is done from within a virtual machine
systemd-dissectIntrospect and interact with file system OS disk images233
systemd-escapeHelper utility to escape or unescape text strings for usage in systemd units216
systemd-firstbootPerforms specific actions before or during the first boot of the system
systemd-gpt-auto-generatorUnit generator to automatically discover common paths including partitions
systemd-hwdbManages binary hardware database, a key-value store related to udev219
systemd-id128Generate and show UUIDs (id-128 identifiers)240
systemd-inhibitProvides a lock to prevent events like a system sleep or shutdown to stop execution of an important process
systemd-journal-remoteStream journal messages over the network212
systemd-journal-uploadAllows sending journal messages over the network to another system216
systemd-keyutilAdministration tool for private keys and X.509 certificates257
systemd-logindManages user logins
systemd-machine-id-setupInitialize /etc/machine-id file, so a machine ID is stored
systemd-measureCalculate and sign TPM2 PCR values for provided UKI252
systemd-mountCreate or start a mount or automount unit232
systemd-notifyNotify service manager about daemon status changes
systemd-network-generatorGenerates a network configuration from the kernel command line243
systemd-network-wait-onlineWait for network connectivity using systemd-networkd212
systemd-networkdSystem service to manage network connectivity
systemd-nspawnRun a command or OS in a light-weight container
systemd-pathQuery system and user paths215
systemd-pcrphaseAllows binding access to TPM2-encrypted secrets, such as for LUKS, to just specific phases of the boot itself, but not later.252
systemd-readaheadAnalyze readahead files that are created during boot186
systemd-repartAutomatically create and grow partitions245
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 service205
systemd-sbsignSign EFI binaries (PE) for Secure Boot257
systemd-socket-activeTool to test socket activation of daemons
systemd-socket-proxydSocket forwarder proxy daemon for IPv4, IPv6, and UNIX stream sockets209
systemd-ssh-proxyUtility to allow ssh to connect to AF_VSOCK and AF_UNIX sockets using ProxyCommand256
systemd-stdio-bridgeProxy between STDIN/STDOUT and a bus within D-Bus
systemd-sysextActivates system extension images to dynamically extend existing file paths (/opt, /usr)248
systemd-sysupdatedSystem service to update the system via unprivileged clients (uses D-Bus)257
systemd-sysusersAllocation of system users and groups215
systemd-tmpfilesDeals with temporary files, such as its creation and deletion
systemd-tty-ask-password-agentList or process queued systemd password requests
systemd-udevdListens to kernel uevents and perform instructions as defined in udev rules183
systemd-umountUnmount utility for specific unit files
systemd-userdbdTranslates user/group lookups to JSON user/group record definitions, including support for classic UNIX/glibc NSS records
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 instead255
timedatectlShow information about clock sources and synchronization state
udevadmManage runtime behavior of systemd-udevd and gathering information about kernel events, event queue, and some basic troubleshooting with udev
updatectlCheck and install system updates that are managed by systemd-sysupdated257
userdbctlUtility that interacts with systemd-userdbd to show available users
varlinkctlLookup or request a specific varlink service255

Missing a particular command? Let it know!

Articles for Commands