change the root directory to the supplied directory newroot and exec command, if supplied, or an interactive copy of your shell.
Syntax chroot [-u -user] [-g -group] [-G -group,group,...] newroot [command] [ARGS] Options -u Set the USER to user after the chroot has taken place. -g Set the GROUP to group after the chroot has taken place. -G Set the Group List to group(s) after the chroot has taken place.
The following environment variable is referenced by chroot:
SHELL If set, the string specified by SHELL is interpreted as the name
of the shell to exec.
If the variable SHELL is not set, /bin/sh is used.
“Humility, that low, sweet root, From which all heavenly virtues shoot” - Thomas Moore (The Loves of the Angels)
Related macOS commands:
cron - Daemon to execute scheduled commands.
exec - Execute a command.
if - Conditionally perform a command.
nohup - Run a command immune to hangups.
su - Run a command with substitute user and group id.
chdir - change the current working Folder.