selinuxenabled(8)
β¨ selinuxenabled(8) β¨
okay bestie, so this is a lil page from the SELinux Command Line documentation set π and honestly? it's the most no-nonsense, one-job-and-she-does-it icon in the whole toolbox π
πΈ NAME πΈ
selinuxenabled β it's the tool you use inside shell scripts to figure out whether SELinux is enabled or not π¦
π SYNOPSIS π
selinuxenabled
that's it. no flags. no arguments. she said zero options, maximum clarity β¨
π§ DESCRIPTION π§
It tells you whether SELinux is enabled or disabled. That's the whole vibe. It doesn't print anything, it doesn't lecture you, it just indicates the state and dips π«
π EXIT STATUS π
okay this is the actual main character part, because in script-land your exit status is your entire personality:
- exits with status
0if SELinux is enabled π - exits with status
1if SELinux is not enabled π
bestie listen. it's 0 for yes, 1 for no. that's the classic shell "truthy" arrangement, so you can just slam it straight into an if and let it cook π
π AUTHOR π
Dan Walsh, <dwalsh@redhat.com> β shoutout to the legend, we love her π«Ά
β SEE ALSO β
like obviously go read getenforce(8) next if you want the actual answer printed at you instead of just an exit code π
and that's the whole page, fr fr β no cap, it was written by dwalsh@redhat.com back on 7 April 2004, and it's still out here being selinuxenabled(8) in the SELinux Command Line documentation. iconic behavior only ππβ¨
π¦ where this page comes from
- alpine 3.24: libselinux-doc 3.10-r1 Β· Public-Domain
- centos-stream 10: libselinux-utils 3.11-3.el10 Β· LicenseRef-Fedora-Public-Domain
- centos-stream 9: libselinux-utils 3.6-5.el9 Β· Public Domain
- debian bookworm: selinux-utils 3.4-1+b6
- debian trixie: selinux-utils 3.8.1-1 Β· LicenseRef-public-domain
- fedora 43: libselinux-utils 3.9-5.fc43 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-utils 3.10-1.fc44 Β· LicenseRef-Fedora-Public-Domain
- fedora 44: libselinux-utils 3.11-2.fc44 Β· LicenseRef-Fedora-Public-Domain
- nixos 26.05: libselinux 3.10
- nixpkgs unstable: libselinux 3.11
- opensuse-leap 16.0: selinux-tools 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: selinux-tools 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: selinux-tools 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- opensuse-leap 16.0: selinux-tools 3.8.1-160000.4.1 Β· SUSE-Public-Domain
- ubuntu jammy: selinux-utils 3.3-1build2
- ubuntu noble: selinux-utils 3.5-2ubuntu2 Β· LicenseRef-public-domain
- ubuntu noble: selinux-utils 3.5-2ubuntu2.1 Β· LicenseRef-public-domain
- ubuntu questing: selinux-utils 3.8.1-1build1
- ubuntu resolute: selinux-utils 3.9-4build1 Β· LicenseRef-public-domain
- ubuntu stonking: selinux-utils 3.11-2.1 Β· LicenseRef-public-domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms