chroot
v0.0.18
chroot [OPTION]... NEWROOT [COMMAND [ARG]...]
Run COMMAND with root directory set to NEWROOT.
Options
--user=<USER>,-u <USER>-
User (ID or name) to switch before running the program
--group=<GROUP>,-g <GROUP>-
Group (ID or name) to switch to
--groups=<GROUP1,GROUP2...>,-G <GROUP1,GROUP2...>-
Comma-separated list of groups to switch to
--userspec=<USER:GROUP>-
Colon-separated user and group to switch to. Same as -u USER -g GROUP. Userspec has higher preference than -u and/or -g
--skip-chdir-
Use this option to not change the working directory to / after changing the root directory to newroot, i.e., inside the chroot.
--help,-h-
Print help
--version,-V-
Print version
Examples
Run command as new root directory:
chroot {{path/to/new/root}} {{command}}
Specify user and group (ID or name) to use:
chroot --userspec={{user:group}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.