Home OS X
OS X Syntax

chroot

Run a command with a different root directory
'chroot' runs a command with a specified root directory. On many systems, only the super-user can do this.

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 chroot command changes its root directory to the supplied directory newroot and exec's command, if supplied, or an interactive copy of your shell.

A mission statement is defined as "a long awkward sentence that demonstrates management's inability to think clearly." All good companies have one. - Scott Adams, The Dilbert Principle, 1996"

Related 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
setgid(2), setgroups(2), setuid(2), getgrnam(3) and getpwnam(3).

Equivalent BASH command:

chroot
- Substitute user identity.



Back to the Top

Simon Sheppard
SS64.com