LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

systemctl-is-active

Check if units are running

TLDR

Check if unit is active
$ systemctl is-active [unit]
copy
Check multiple units
$ systemctl is-active [unit1 unit2 ...]
copy
Quiet mode (exit code only)
$ systemctl is-active [unit] -q
copy
Check user unit
$ systemctl is-active [unit] --user
copy

SYNOPSIS

systemctl is-active [OPTIONS] PATTERN...

DESCRIPTION

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.

PARAMETERS

-q, --quiet

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

EXIT STATUS

Returns 0 if at least one unit is active, non-zero otherwise. This makes it useful in shell scripts for conditional logic based on service state.

CAVEATS

Only checks current runtime state, not enablement. A unit can be enabled but not active, or active but not enabled. Use `is-enabled` to check the boot configuration.

HISTORY

The is-active subcommand provides a scriptable way to query service state, replacing parsing of `systemctl status` output.

SEE ALSO

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid