Manual pages › System administration commands (1M)
chroot(1M)
change root directory for a command
From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.
Also by this name: chroot(1), General commands · chroot(2), System calls
NAME
chroot - change root directory for a command
SYNOPSIS
/usr/sbin/chroot newroot command
DESCRIPTION
chroot causes the given command to be executed relative to the new root. The meaning of any initial slashes (/) in the path names is changed for the command and any of its child processes to newroot . Furthermore, upon execution, the initial working directory is newroot .
Notice, however, that if you redirect the output of the command to a file:
chroot newroot command >x
will create the file x relative to the original root of the command, not the new one.
The new root path name is always relative to the current root: even if a chroot is currently in effect, the newroot argument is relative to the current root of the running process.
This command can be run only by the super-user.
SEE ALSO
cd(1) in the User's Reference Manual. chroot(2) in the Programmer's Reference Manual.
NOTES
One should exercise extreme caution when referencing device files in the new root file system.