Print status details for every failed systemd unit
Build a paste-ready command, then review its compatibility and effects before running it.
systemctl --failed --no-legend | awk '{print $1}' | xargs -r systemctl status --no-pager --lines=<lines>Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
LinuxVerified for Linux using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementssystemctlsystemctl must be installed and available on PATH.
Version supportsystemctl Current supported releasesVerified for linux using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signals× backup.service - Nightly backupRepresentative successful output; values vary with the selected target and system state.
Known errorssystemctl: command not foundsystemctl is missing or is not available on PATH.
Verifysystemctl --failed --no-legend | awk '{print $1}' | xargs -r systemctl status --no-pager --lines={{lines}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01systemctlCommandRuns the systemctl stage of this one-liner.
02--failedOptionConfigures systemctl with the --failed option.
03--no-legendOptionOmits the table legend from the output.
04|PipelinePasses the output on the left to the command on the right.
05awkCommandRuns the awk stage of this one-liner.
06'{print $1}'ArgumentPasses '{print $1}' to awk.
07|PipelinePasses the output on the left to the command on the right.
08xargsCommandRuns the xargs stage of this one-liner.
09-rOptionEnables raw, recursive, or reverse mode for this command.
10systemctlArgumentPasses systemctl to xargs.
11statusArgumentPasses status to xargs.
12--no-pagerOptionPrints directly instead of opening an interactive pager.
13--lines=<lines>OptionLimits the number of output lines shown.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
systemctl --failed --no-legend | awk '{print $1}' | xargs -r systemctl status --no-pager --lines=8
Example output
× backup.service - Nightly backup
Loaded: loaded (/etc/systemd/system/backup.service; enabled)
Active: failed (Result: exit-code) since Thu 2026-07-23 02:14:08 CEST
Process: 7129 ExecStart=/usr/local/bin/backup (code=exited, status=23)
Illustrative output — exact values vary by system and data.
Official sources