← 返回命令列表

Linux command

systemctl-is-active 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Example

systemctl is-active [unit]

Example

systemctl is-active [unit1 unit2 ...]

Quiet

systemctl is-active [unit] -q

Example

systemctl is-active [unit] --user

说明

systemctl is-active checks whether one or more units are currently active (running). It prints the active state and returns exit code 0 if at least one unit is active. Possible states include: active, inactive, activating, deactivating, failed. For multiple units, each state is printed on a separate line.

参数

-q, --quiet
Suppress output, return only exit code
--user
Check user units
--system
Check system units (default)

FAQ

What is the systemctl-is-active command used for?

systemctl is-active checks whether one or more units are currently active (running). It prints the active state and returns exit code 0 if at least one unit is active. Possible states include: active, inactive, activating, deactivating, failed. For multiple units, each state is printed on a separate line.

How do I run a basic systemctl-is-active example?

Run `systemctl is-active [unit]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -q, --quiet do in systemctl-is-active?

Suppress output, return only exit code