Download as odt, pdf, or txt
Download as odt, pdf, or txt
You are on page 1of 2

http://www.computerhope.com/unix/chroot.

ht
m

Linux and Unix chroot command


Quick links
About chroot
Syntax
Related commands
Linux and Unix main page

About chroot
chroot runs a command or an interactive shell from another directory, and treats that directory as
root.
This process is called changing root and the new root directory is referred to as chroot jail.
See our chroot definition for further information and history of this command.

Syntax
chroot [OPTION] NEWROOT [COMMAND [ARG]...]

chroot runs COMMAND with the root directory set to NEWROOT.


OPTION may be one of the following:
-specify the user and group to use. USER and GROUP may be specified by
userspec=USER:GRO
name or numeric ID.
UP
--groups=G_LIST

specify supplementary groups as g1,g2,..,gN

--help

display a help message, and exit.

--version

output version information, and exit.

If no command is specified, chroot executes the command '${SHELL} -i'. By default, this is
'/bin/sh -i'. This will drop you into a sh shell as root in the NEWROOT directory.

Related commands
chdir The system function for changing the working directory.

You might also like