mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-26 11:33:59 +00:00
22 lines
555 B
Plaintext
22 lines
555 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# chroot
|
|
|
|
> Run command or interactive shell with special root directory.
|
|
> More information: <https://www.gnu.org/software/coreutils/manual/html_node/chroot-invocation.html>.
|
|
|
|
- Run `$SHELL` in the new root directory:
|
|
|
|
`sudo chroot {{path/to/new_root}}`
|
|
|
|
- Run command as new root directory:
|
|
|
|
`sudo chroot {{path/to/new_root}} {{command}}`
|
|
|
|
- Use a specific user and group:
|
|
|
|
`sudo chroot --userspec {{username_or_id}}:{{group_name_or_id}} {{path/to/new_root}}`
|