Linux Commands Examples

A great documentation place for Linux commands


detect if running in a chroot


ischroot [--default-false] [--default-true] [--help] [--version]

add an example, a script, a trick and tips

: email address (won't be displayed)
: name

Step 2

Thanks for this example ! - It will be moderated and published shortly.

Feel free to post other examples
Oops ! There is a tiny cockup. A damn 404 cockup. Please contact the loosy team who maintains and develops this wonderful site by clicking in the mighty feedback button on the side of the page. Say what happened. Thanks!


no example yet ...

... Feel free to add your own example above to help other Linux-lovers !


ischroot detects if it is currently running in a chroot. The exit status is:


if currently running in a chroot


if currently not running in a chroot


if the detection is not possible (On GNU/Linux this happens if the script is not run as root).


-f, --default-false

Exit with status 1 if the detection is not possible.

-t, --default-true

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.

How can this site be more helpful to YOU ?

give  feedback