ischroot - detect if running in a chroot
| Use Case | Command | Description |
|---|---|---|
| Check if inside chroot | ischroot | Exits 0 in chroot, 1 otherwise |
| Default false on detection failure | ischroot --default-false | Exits 1 if detection impossible |
| Default true on detection failure | ischroot --default-true | Exits 0 if detection impossible |
| Show help | ischroot --help | Display usage message |
| Show version | ischroot --version | Print version information |
ischroot [--default-false] [--default-true] [--help] [--version]
ischroot detects if it is currently running in a chroot. The exit status is:
0 — currently running in a chroot1 — currently not running in a chroot2 — detection impossible (on GNU/Linux this happens if not run as root)0 — running in a chroot1 — not running in a chroot2 — detection not possibleExit with status 1 if the detection is not possible.
Exit with status 0 if the detection is not possible.
Print a usage message on standard output and exit successfully.
Print version information on standard output and exit successfully.
On GNU/Linux, chroot detection is not possible when not root. This works correctly on GNU/Hurd and GNU/kFreeBSD.
Generated by phpman v4.9.27 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-18 17:58 @2600:1f28:365:80b0:f8a4:e764:d6bb:8e66
CrawledBy CCBot/2.0 (https://commoncrawl.org/faq/)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format