commands

getenforce — Inspect SELinux mode

Report enforcing, permissive or disabled state on supported systems. Optional VM inspection only. Use a fresh private workspace; do not apply to a real system.

Formal Syntax & Structure

linux syntaxlinux
getenforce

Return Value

exit status and output

Prints Enforcing, Permissive or Disabled on supported systems. A successful query of Disabled or Permissive is not evidence of enforcement; inspect the mode text.

Working Example

Example Snippetlinux
getenforce
Linux Reference