Sortix
Sortix Download Manual Development Source Code News Blog More
current nightly

Sortix nightly manual

This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.

NAME

chroot — run command with changed root directory

SYNOPSIS

chroot [-dI] newroot [command [arguments ...]]

DESCRIPTION

chroot changes the root directory to newroot and runs command with the given arguments. command defaults to sh(1). The working directory for command is changed to /.
The options are as follows:
-d, --devices
Mount /dev from the host system into the /dev inside newroot. The mountpoint is removed when command completes. This option is useful for running installations.
-I, --init
Become an init process using setinit(2) and transfer the controlling terminal temporarily to the new session using the TIOCSCTTY ioctl(2).

ENVIRONMENT

The environment is preserved. PATH is used to search for command.

EXIT STATUS

chroot will exit 0 on success and non-zero otherwise.

SEE ALSO

chroot(2)
Copyright 2011-2025 Jonas 'Sortie' Termansen and contributors.
Sortix's source code is free software under the ISC license.
#sortix on irc.sortix.org
@sortix_org