systemctl / systemd commands

systemctl and journalctl command lines for systemd 262, taken from the project's own manual pages and grouped by task: starting and stopping units, enabling them at boot, inspecting state, unit files and overrides, targets and power, user units, and logs. Capitals such as PATTERN..., UNIT or TIMESPAN stand for your own value, and a unit name without a suffix means a .service unit. Environment variables, disk-image options and other systemd tools such as systemd-analyze and loginctl are left out.

182 commands in 8 sections. Checked row by row against systemctl(1) manual page, systemd 262 (systemd project, freedesktop.org) on . Edited by Jay.

Starting and stopping 22

Rows that pair an option with a command use the UNIT... placeholder of the manual's synopsis line; a command accepts globs where its own row says PATTERN....

CommandWhat it does
systemctl start PATTERN...Start unitsSeveral units named together are queued as one transaction, so their After=/Before= ordering is respected.
systemctl start sshdStart a unit by short nameA name given without a suffix gets .service appended, so sshd and sshd.service are the same unit.
systemctl start --all GLOBStart matching inactive unitsGlobs normally match only units in memory; --all extends them to inactive units that loaded units refer to.
systemctl start --no-block UNIT...Start without waitingThe job is only checked and queued; systemctl returns before the unit has finished starting.
systemctl start --wait UNIT...Start and wait for exitBlocks until the started units stop again, and never returns for a unit that does not terminate.
systemctl start --show-transaction UNIT...Show the jobs a start queuesShort form -T; lists the requested job together with those pulled in by dependencies.
systemctl --verbose COMMANDShow unit logs during an operationShort form -v, added in systemd 258; the unit's log lines are printed while the job runs.
systemctl stop PATTERN...Stop unitsFails for a missing unit or one that refuses manual stops, but not when its ExecStop= commands fail.
systemctl stop "sshd@*.service"Stop all instances of a templateA quoted glob is matched against units in memory, and a pattern matching nothing is skipped silently.
systemctl restart PATTERN...Restart unitsUnits that are not running are simply started; the unit's stored file descriptors survive unless you stop and start instead.
systemctl try-restart PATTERN...Restart only running unitsStopped units are left alone instead of being started.
systemctl reload PATTERN...Reload a service's configurationThe service re-reads its own configuration, such as Apache's httpd.conf; the systemd unit file is not reloaded.
systemctl reload-or-restart PATTERN...Reload, or restart if unsupportedUnits that cannot reload are stopped and started, and units that are not running get started.
systemctl try-reload-or-restart PATTERN...Reload or restart running unitsFalls back from reload to restart in the same way, but leaves stopped units stopped.
systemctl enqueue-markedQueue jobs for marked unitsActs on units whose Markers property carries a needs-* marker; a reload falls back to restart where unsupported.
systemctl kill PATTERN...Send a signal to a unitBy default SIGTERM goes to every process of the unit; --kill-whom= narrows that to main, control or cgroup.
systemctl kill -s SIGNAL UNIT...Send a chosen signalLong form --signal=; takes a signal name like SIGINT or SIGSTOP, and the value help prints the known names.
systemctl freeze PATTERN...Freeze a unit's processesEvery process in the unit's cgroup is suspended until thawed; requires the unified cgroup hierarchy.
systemctl thaw PATTERN...Resume frozen unitsReverses freeze: processes in the unit's cgroup are scheduled to run again.
systemctl reset-failed [PATTERN...]Clear the failed stateAlso zeroes the start rate limit counter, so a unit that hit its start limit can be started again.
systemctl clean PATTERN...Remove a unit's stored dataThe unit must be stopped first; with no --what=, cache, runtime data and the file descriptor store go.
systemctl clean --what=state PATTERN...Remove one kind of unit data--what= accepts state, cache, logs, runtime, configuration, fdstore or all; for a timer, state clears its persistent timestamp.

Enabling at boot 18

Enabling and starting are independent: enabling hooks a unit into boot or hardware events, starting runs it now, and either can be done without the other.

CommandWhat it does
systemctl enable UNIT...Enable unitsCreates the symlinks named in each unit file's [Install] section and reloads the manager, but does not start anything.
systemctl enable PATH...Enable a unit file by pathTakes an absolute path; a file outside the usual unit directories is also linked into the configuration path.
systemctl enable --now UNIT...Enable and start togetherStarts the units once their symlinks exist; the flag also pairs with disable, mask and reenable.
systemctl enable --runtime UNIT...Enable until the next rebootThe change is written under /run/ rather than /etc/, so it disappears at the next boot.
systemctl enable --force UNIT...Enable over conflicting symlinksShort form -f; any symlink already in the way is replaced.
systemctl enable --no-reload UNIT...Enable without reloadingSkips the implicit reload of the manager configuration; also valid with disable, preset, mask and unmask.
systemctl disable UNIT...Disable unitsRemoves every symlink to the unit file, hand-made ones included, and leaves a running unit running.
systemctl disable --now UNIT...Disable and stop togetherStops the units after their symlinks are removed, which plain disable does not do.
systemctl reenable UNIT...Reset enablement symlinksRuns disable and then enable, returning the links to what the [Install] section prescribes.
systemctl is-enabled UNIT...Check whether units are enabledPrints a state such as enabled, static or masked; the exit code is 0 when at least one unit is enabled.
systemctl is-enabled --full UNIT...Check enablement with targetsShort form -l; the installation targets are printed next to the state.
systemctl mask UNIT...Mask unitsPoints the unit file at /dev/null so the unit cannot be started at all, by hand or through enabling.
systemctl mask --now UNIT...Mask and stop togetherMakes sure the masked units are also stopped rather than left running.
systemctl mask --runtime UNIT...Mask until the next rebootThe /dev/null link is created under /run/systemd/system/ instead of /etc/systemd/system/.
systemctl unmask UNIT...Unmask unitsReverses mask; only unit names are accepted, not paths to unit files.
systemctl preset UNIT...Apply preset policy to unitsEnables or disables each unit as the preset files prescribe; units without install information are skipped silently.
systemctl preset-allApply presets to all unit files--preset-mode= can restrict the run to enabling only or to disabling only.
systemctl list-unit-files [PATTERN...]List installed unit filesShows the enablement state of each file and, unlike list-units, includes template units.

Inspecting state 39

Exit codes follow the LSB convention, but the manual advises looking at unit states and substates rather than relying on the return value.

CommandWhat it does
systemctl status [PATTERN...|PID...]Show unit statusPrints runtime state plus the latest journal lines; with no argument it reports on the whole system.
systemctl status /homeShow the mount unit for a pathAn absolute path is converted to a mount unit name, or to a device unit name for a device node.
systemctl status -n INTEGER UNIT...Set the status log line countLong form --lines=; ten lines appear by default and 0 turns the journal excerpt off.
systemctl status -l UNIT...Show status without truncationLong form --full; names, the process tree and journal lines are no longer cut short.
systemctl status --with-dependencies UNIT...Show status with dependenciesPrints the named units plus their dependencies; --reverse, --after and --before change which kind is shown.
systemctl is-active PATTERN...Check whether units are activeExit code 0 when at least one unit is active; the state is also printed.
systemctl is-active --quiet PATTERN...Test activity without outputSuppresses the printed state, leaving the exit code as the only answer.
systemctl is-failed [PATTERN...]Check whether units have failedExit code 0 when at least one has failed; with no unit it checks the whole system for failures.
systemctl show [PATTERN...|JOB...]Show propertiesMachine-readable output for units, jobs or, without arguments, the manager itself; unset properties are hidden by default.
systemctl show --all UNIT...Show empty properties tooProperties without a value are otherwise left out of the listing.
systemctl show -p MainPID UNIT...Show selected propertiesLong form --property=; takes property names separated by commas and can be repeated.
systemctl show -P PROPERTY UNIT...Print only a property's valueSame as --value --property=, so the name and the equals sign are dropped from the output.
systemctl list-units [PATTERN...]List loaded unitsThe default when no command is given; lists units that are active, have pending jobs or have failed.
systemctl list-units --allList inactive units tooShort form -a; still limited to units in memory, so use list-unit-files for everything installed.
systemctl list-units -t serviceList loaded servicesLong form --type=; several unit types can be given, separated by commas.
systemctl -t helpList the unit typesPrints the unit types the filter accepts and exits.
systemctl list-units --state=failedFilter units by stateTakes LOAD, SUB or ACTIVE states separated by commas; failed is one of them.
systemctl --failedList failed unitsShorthand for --state=failed; with no command named, list-units is the one that runs.
systemctl --state=helpList the possible unit statesThe LOAD, ACTIVE and SUB values differ between systemd releases, so ask the installed version.
systemctl list-timers [PATTERN...]List timersSorted by when each timer fires next; also shows its last run and the unit it activates.
systemctl list-sockets [PATTERN...]List socketsSorted by listening address, with the unit each socket activates; --show-types adds the socket type.
systemctl list-paths [PATTERN...]List path unitsSorted by path, with the condition being watched and the unit each one activates.
systemctl list-automounts [PATTERN...]List automount pointsSorted by mount path, with what is mounted there and the idle timeout.
systemctl list-dependencies [UNIT...]Show a unit's dependency treeFollows Requires=, Wants= and related dependencies recursively, starting from default.target when no unit is named.
systemctl list-dependencies --reverse UNIT...Show what depends on a unitFollows WantedBy=, RequiredBy= and similar reverse links rather than the forward ones.
systemctl list-dependencies --after UNIT...Show units ordered before a unitWalks the After= dependency recursively to list what the unit is ordered behind.
systemctl list-dependencies --before UNIT...Show units ordered after a unitWalks the Before= dependency recursively; with list-jobs it shows which jobs each job waits for.
systemctl list-dependencies --all UNIT...Expand every dependencyShort form -a; without it only target units are expanded recursively.
systemctl list-dependencies --plainPrint dependencies as a flat listDrops the tree drawing and the bullet circles; list-units and list-machines accept it too.
systemctl list-jobs [PATTERN...]List jobs in progressAdd --after or --before to see which jobs each one waits for and which wait for it.
systemctl cancel [JOB...]Cancel queued jobsTakes numeric job IDs; with none given, every pending job is cancelled.
systemctl whoami [PID...]Find the unit of a processPrints one unit per PID; with no PID it names the unit systemctl itself was started from.
systemctl help PATTERN...|PID...Open a unit's manual pagesGiven a PID, opens the pages of the unit that process belongs to.
systemctl is-system-runningCheck overall system statePrints a state such as running, degraded or maintenance; exit code 0 only when fully up with nothing failed.
systemctl is-system-running --waitWait until boot has finishedBlocks while the system is still initializing or starting, then prints the state it reached.
systemctl --no-pager COMMANDPrint without a pagerOutput is written directly; setting SYSTEMD_PAGER to cat or to an empty string does the same.
systemctl --legend=BOOL COMMANDShow or hide the legendCovers the column headers and the hint footer, both printed by default.
systemctl --quiet COMMANDSuppress result outputShort form -q; errors still print, and commands whose output is the whole point, like show, are unaffected.
systemctl --versionPrint the systemd versionThe manual marks newer commands with the release that added them, so compare against this number.

Unit files and overrides 18

CommandWhat it does
systemctl cat PATTERN...Print a unit's filesShows the unit file and its drop-ins as stored on disk, each under a comment naming the file.
systemctl edit UNIT...Edit a drop-in overrideOpens override.conf for the unit in an editor and reloads the configuration once the editor exits successfully.
systemctl edit --full UNIT...Edit a replacement unit fileEdits a full copy that takes the place of the main unit file, rather than a drop-in.
systemctl edit --drop-in=NAME UNIT...Edit a named drop-inThe snippet is saved under NAME in place of the default override.conf.
systemctl edit --runtime UNIT...Edit a temporary overrideThe drop-in is written under /run/ and is gone after the next reboot.
systemctl edit --force UNIT...Create a missing unitShort form -f; lifts the rule that the unit must already exist, and with --full a new unit file is written.
systemctl edit --drop-in=limits.conf --stdin some-service.serviceWrite a drop-in from standard inputNo editor opens; whatever is piped in overwrites the drop-in completely, which suits scripts.
systemctl revert UNIT...Revert to the vendor unit fileDeletes the unit's drop-ins and any overriding copy and unmasks it, undoing edit, set-property and mask.
systemctl daemon-reloadReload unit filesReruns the generators, rereads every unit file and rebuilds the dependency tree; unrelated to the reload command.
systemctl daemon-reexecRe-execute the managerSaves the manager's state, restarts its process and restores the state; mostly for package upgrades and debugging.
systemctl link PATH...Link an outside unit fileTakes an absolute path and makes that file usable by start and similar commands; disable removes the link.
systemctl add-wants TARGET UNIT...Add Wants= dependencies to a targetThe listed units become Wants= dependencies of TARGET; scope options behave as they do for enable.
systemctl add-requires TARGET UNIT...Add Requires= dependencies to a targetSame as add-wants, except that the dependency type recorded is Requires=.
systemctl set-property UNIT PROPERTY=VALUE...Set unit properties at runtimeTakes effect immediately and is saved for later boots; mostly resource-control settings can be changed this way.
systemctl set-property --runtime UNIT PROPERTY=VALUE...Set a property until rebootThe setting is applied now but not saved for later boots.
systemctl set-property foobar.service CPUWeight=200Set a service's CPU weightAssignments use unit-file syntax; several can follow one unit name, and an empty value resets a property.
systemctl bind UNIT PATH [PATH]Bind-mount a host pathSource path on the host first, then the destination inside the unit; --read-only and --mkdir adjust the mount.
systemctl mount-image UNIT IMAGE [PATH [PARTITION_NAME:MOUNT_OPTIONS]]Mount an image into a unitMounts a disk image from the host at a directory inside the unit's namespace, with optional per-partition mount options.

Targets and power 25

CommandWhat it does
systemctl get-defaultShow the default boot targetPrints the target unit that default.target is a symlink to.
systemctl set-default TARGETSet the default boot targetRepoints the default.target symlink at the target you name.
systemctl isolate UNITSwitch to a targetStarts the unit with its dependencies and stops everything else, possibly including your graphical session or terminal.
systemctl defaultReturn to the default targetSame as isolating default.target; it blocks until done unless --no-block is given.
systemctl rescueEnter rescue modeIsolates rescue.target and waits for the switch to finish unless --no-block is passed.
systemctl emergencyEnter emergency modeShorthand for systemctl isolate emergency.target, which blocks by default.
systemctl haltHalt the systemStops the kernel after shutdown but leaves the hardware powered on; all users get a wall message.
systemctl poweroffPower off the systemShuts down and cuts power, returning as soon as the request is queued rather than when it completes.
systemctl rebootReboot the systemReturns once the reboot is queued; if a kernel was loaded with kexec --load, a kexec happens instead.
systemctl reboot --firmware-setupReboot into firmware setupAsks the firmware to open its setup screen at the following start; not every system supports it.
systemctl reboot --boot-loader-entry=IDReboot into a boot loader entryID names the entry to boot next; the value help lists the entries that exist.
systemctl reboot --boot-loader-menu=TIMEOUTReboot to the boot loader menuTIMEOUT sets how long the menu waits; zero switches the timeout off.
systemctl reboot --when TIMESTAMPSchedule a rebootLong form --when=; the values show and cancel display or drop the scheduled action, also for halt, poweroff and kexec.
systemctl reboot --forceReboot without stopping unitsProcesses are killed and file systems unmounted or made read-only; given twice, even that is skipped and data may be lost.
systemctl reboot --no-wallReboot without a wall messageSkips the broadcast message to users; halt and poweroff accept the flag too.
systemctl reboot --dry-runPrint what a reboot would doNothing is executed; the other power, sleep and rescue-mode verbs accept it as well.
systemctl kexecReboot through kexecLoads the default boot entry's kernel if none is loaded yet, which needs UEFI and configured boot loader entries.
systemctl soft-rebootReboot userspace onlyThe kernel keeps running while userspace is shut down and brought up again.
systemctl sleepSend the system to sleepsystemd-logind picks the operation; suspend-then-hibernate is the default, with suspend and then hibernate as fallbacks.
systemctl suspendSuspend the systemActivates suspend.target and returns once the request is queued, without waiting for the resume.
systemctl hibernateHibernate the systemActivates hibernate.target; as with suspend, --force bypasses an error reported by systemd-logind.
systemctl hybrid-sleepHibernate and suspend togetherActivates hybrid-sleep.target and returns as soon as the operation is queued.
systemctl suspend-then-hibernateSuspend, then hibernate laterHibernation follows when the battery runs low or the delay from systemd-sleep.conf has passed.
systemctl exit [EXIT_CODE]Quit the service managerMeant for user managers and containers; anywhere else it acts like poweroff, and EXIT_CODE sets the exit status.
systemctl switch-root [ROOT [INIT]]Switch to a new root directoryUsed in the initrd to hand over to the host's system manager; ROOT defaults to /sysroot/.

User units and other managers 11

CommandWhat it does
systemctl --user COMMANDUse your user service managerThe command goes to the calling user's own manager instead of the system-wide one.
systemctl --system COMMANDUse the system service managerThis is already the default, so the flag only makes the choice explicit.
systemctl --user exitQuit your user managerEnds the calling user's service manager; the command returns as soon as the request is queued.
systemctl daemon-reload --userReload user unit filesThe user-manager counterpart of daemon-reload --system; edit runs one of the two after the editor closes.
systemctl edit --user UNIT...Edit a user unit overrideWorks on the calling user's unit files; --global instead targets the files shared by every user.
systemctl --global enable UNIT...Enable a user unit for all usersWrites to the configuration directory shared by all users, so the unit starts in every user's future logins.
systemctl --global disable UNIT...Disable a user unit for all usersTakes the unit back out of the configuration directory that all users share.
systemctl --user [email protected] COMMANDReach another user's managerThe special name .host stands for the local system, so this connects to the user bus of the named user.
systemctl -H HOST COMMANDRun a command on a remote hostLong form --host=; connects over SSH and accepts user@host, with an optional :port and /container suffix.
systemctl -M CONTAINER COMMANDRun a command in a local containerLong form --machine=; a user name and @ may come before the container name, otherwise root is used.
systemctl list-machines [PATTERN...]List the host and containersShows the state of the host and of each running local container.

Manager environment and log levels 9

CommandWhat it does
systemctl show-environmentPrint the manager environmentThe output can be sourced by most shells; it is the block handed to every process the manager starts.
systemctl set-environment VARIABLE=VALUE...Set manager environment variablesFails if a name or value breaks the naming rules; the variables join the block handed to spawned processes.
systemctl unset-environment VARIABLE...Unset manager environment variablesA bare name removes the variable whatever its value; NAME=VALUE removes it only when the value matches.
systemctl import-environment VARIABLE...Import client environment variablesCopies the named variables from the calling shell into the manager; importing everything by naming none is deprecated.
systemctl log-level [LEVEL]Show or set the manager log levelWithout an argument the current level is printed; with one, the manager switches to that level.
systemctl log-target [TARGET]Show or set the manager log targetPrints where the manager sends its log, or redirects it when a target is supplied.
systemctl service-log-level SERVICE [LEVEL]Show or set a service's log levelLevels are the syslog ones, emerg to debug or 0 to 7; the service must implement the LogControl1 D-Bus interface.
systemctl service-log-target SERVICE [TARGET]Show or set a service's log targetTargets are console, kmsg, journal, syslog, null or auto; most services only make sense with console, journal and null.
systemctl service-watchdogs [yes|no]Show or toggle service watchdogsTurns WatchdogSec= watchdogs and emergency actions such as OnFailure= on or off for all services; the hardware watchdog is untouched.

Logs 40

Every user can read their own journal; the system journal is open to root and to members of the systemd-journal, adm and wheel groups.

CommandWhat it does
journalctlShow the whole journalEntries print oldest first through a pager; add matches or options to narrow them down.
journalctl -u UNITShow a unit's logLong form --unit=; a pattern is accepted too, and the option can be repeated for several units.
journalctl -fFollow new entriesLong form --follow; prints the latest entries and keeps going as new ones arrive, until Ctrl-C.
journalctl -f -u apacheFollow one service liveCombines the follow and unit options; the manual's own example watches apache.service.
journalctl -bShow the current bootLong form --boot; with no argument only messages from this boot are printed.
journalctl -b -1Show the previous bootZero and negative offsets count back from the latest boot; positive ones count up from the oldest.
journalctl -kShow kernel messages onlyLong form --dmesg; limited to the current boot unless another boot is asked for.
journalctl -k -b -1Show the previous boot's kernel logThe explicit -b -1 replaces the current-boot limit that -k applies by itself.
journalctl --since todayShow entries since midnightShort form -S; also accepts yesterday, now, a full date and time, or a relative offset.
journalctl --since yesterday --until todayShow one day's entriesBoth words resolve to 00:00:00 of their day, so this covers all of yesterday.
journalctl -p errShow errors and worseLong form --priority=; a single level also selects every more important one, here err through emerg.
journalctl -p FROM..TOShow a priority rangeBoth ends are included; levels can be names or the numbers 0 to 7.
journalctl -nShow the last ten entriesLong form --lines=; ten is the default count when no number follows.
journalctl -n INTEGERShow the last N entriesA leading + takes the oldest entries instead, and all removes the limit.
journalctl -eOpen the pager at the endLong form --pager-end; implies the last 1000 lines of the current boot and only works with less.
journalctl -rShow newest entries firstLong form --reverse; flips the default oldest-first order.
journalctl -xAdd catalog explanationsLong form --catalog; attaches help texts to messages that have one, and should be left off in bug reports.
journalctl -o jsonOutput entries as JSONLong form --output=json; one object per line, and fields above 4096 bytes are encoded as null.
journalctl -o json-prettyOutput readable multi-line JSONThe same JSON structures as json, spread over several lines for human readers.
journalctl -o catPrint message text onlyDrops all metadata, timestamps included, leaving just the message of each entry.
journalctl -o short-isoUse ISO 8601 timestampsKeeps the one-line syslog-style layout but prints times in the RFC 3339 profile.
journalctl -o verboseShow every field of each entryLong form --output=verbose; entries are printed as structured items rather than one line each.
journalctl -g PATTERNSearch message textLong form --grep=; a PERL-compatible regular expression, and an all-lowercase pattern ignores case.
journalctl -t SYSLOG_IDENTIFIERFilter by syslog identifierLong form --identifier=; may be repeated, and -T excludes an identifier instead.
journalctl --user-unit=NAMEShow a user unit's logFor units of a user service manager; with --user, plain -u arguments are treated the same way.
journalctl --userShow the current user's messagesLimits output to services of the calling user; --system does the same for system services and kernel messages.
journalctl --list-bootsList recorded bootsEach boot gets an offset from the current one, its ID and the times of its first and last message.
journalctl --disk-usageShow journal disk usageThe total covers active files as well as archived ones.
journalctl --vacuum-time TIMESPANDelete archived logs by ageLong form --vacuum-time=; drops archived files past that age, written with suffixes like h, days or weeks.
journalctl --vacuum-size SIZEDelete archived logs by sizeLong form --vacuum-size=; deletes oldest archives first until they fit, with K, M, G or T suffixes.
journalctl --vacuum-files NUMBERLimit the count of journal filesLong form --vacuum-files=; keeps only that many separate files, though active files are never removed.
journalctl --rotateRotate journal filesActive files are archived and fresh ones started; can be combined with the vacuum options in one command.
journalctl --syncWrite pending log data to diskReturns only when everything logged before the call is safely stored.
journalctl --flushMove runtime logs to /varCopies the runtime journal into persistent storage under /var when that is enabled, and only once while the system is up.
journalctl --no-pagerPrint the journal without a pagerBy default output is paged through less and long lines are cut to the screen width.
journalctl _SYSTEMD_UNIT=avahi-daemon.serviceMatch on a journal fieldTwo different fields must both match; the same field given twice matches either value.
journalctl /usr/bin/dbus-daemonShow logs from one executableA path to an executable binary is turned into an _EXE= match.
journalctl -D DIRRead journals from a directoryLong form --directory=DIR; the usual runtime and system journals are not read.
journalctl --file=GLOBRead specific journal filesShort form -i GLOB; can be repeated, and entries from all the files are interleaved.
journalctl -F FIELDList the values of a fieldLong form --field=; -N prints the field names in use instead.

Notes

Start versus enable

systemctl start PATTERN... runs a unit now and systemctl stop PATTERN... stops it; neither changes what happens at boot. systemctl enable UNIT... creates the symlinks that bring it up at boot and systemctl disable UNIT... removes them, without touching the running state — so a freshly installed service usually needs both, and systemctl enable --now UNIT... does the two together. systemctl restart PATTERN... stops and then starts the unit; systemctl reload PATTERN... asks the service to re-read its own configuration when it supports that, which is not the same as reloading the unit file.

When it will not start

systemctl status [PATTERN...|PID...] shows whether the unit is loaded and active, its main PID and the most recent journal lines — read it first. journalctl -u UNIT prints the unit's whole log, journalctl -f -u apache is the manual's example of following one service live, journalctl --since today narrows the journal by time and journalctl -p err keeps errors and worse. After editing a unit file by hand, systemctl daemon-reload is required before the change is seen, and forgetting it is the classic reason a fix "did not work". systemctl list-units -t service lists loaded services with their states; systemctl --failed shows only the failed units.

Beyond services

The same verbs apply to timers (systemd's cron), sockets and mounts — systemctl list-timers [PATTERN...] shows when each timer fires next. systemctl cat PATTERN... prints the unit file with any drop-in overrides, and systemctl edit UNIT... creates an override.conf drop-in without editing the packaged file; systemctl revert UNIT... removes such overrides again. Per-user units are reached with systemctl --user COMMAND.

Questions

What is the difference between systemctl start and systemctl enable?

systemctl start PATTERN... runs a unit now. systemctl enable UNIT... creates the symlinks that bring it up at boot or on another trigger, and does not start it. The manual calls the two orthogonal: a unit can be enabled without running, or running without being enabled. systemctl enable --now UNIT... does both in one step.

Why did editing a unit file change nothing?

The manager keeps what it loaded until systemctl daemon-reload reruns the generators and rereads the unit files. systemctl edit UNIT... performs that reload itself when the editor exits. systemctl reload PATTERN... is a different command: it asks the service to re-read its own configuration, not the unit file.

What is the difference between disable and mask?

systemctl disable UNIT... only removes the enablement symlinks. systemctl mask UNIT... is the stronger form: it links the unit file to /dev/null, so the unit cannot be activated in any way, a manual start included, until systemctl unmask UNIT... undoes it.

How do I find out why a service failed?

Start with systemctl status [PATTERN...|PID...], which shows the unit state and its latest journal lines, then read the full log with journalctl -u UNIT. systemctl --failed lists every failed unit, and systemctl reset-failed [PATTERN...] clears the failed state and the start-limit counter once the cause is fixed.

Which systemd version do these commands need?

The rows follow the manual pages for systemd 262. Most commands are far older, but a few are recent: the manual marks systemctl sleep as added in version 256, systemctl --verbose COMMAND in 258 and systemctl enqueue-marked in 260. systemctl --version prints the version a machine runs.

Sources and checks

Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.

Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.