Show key runtime properties for a service
Build a paste-ready command, then review its compatibility and effects before running it.
systemctl show <unit> -p ActiveState,SubState,MainPID,ExecMainStatusComplete required fields to copy the generated command.
read-onlyno known side effects Compatibility
LinuxVerified for Linux using posix, bash, zsh syntax.
Operational knowledgereview due 2027-01-20
Requirementssystemctlsystemctl must be installed and available on PATH.
Version supportsystemctl Current supported releasesVerified for linux using posix, bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsMainPID=842Representative 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 show {{unit}} -p ActiveState,SubState,MainPID,ExecMainStatusThe 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.
02showArgumentPasses show to systemctl.
03<unit>ParameterA value supplied in the Fill parameters section.
04-pOptionSelects the command-specific port, process, or print mode.
05ActiveState,SubState,MainPID,ExecMainStatusArgumentPasses ActiveState,SubState,MainPID,ExecMainStatus to systemctl.
Example input
systemctl show nginx.service -p ActiveState,SubState,MainPID,ExecMainStatus
Example output
MainPID=842
ExecMainStatus=0
ActiveState=active
SubState=running
Illustrative output — exact values vary by system and data.
Official sources