1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-22 20:02:09 +02:00
tldr/pages/linux/nsenter.md
2024-07-23 22:29:22 +05:30

21 lines
848 B
Markdown

# nsenter
> Run a new command in a running process' namespace.
> Particularly useful for Docker images or chroot jails.
> More information: <https://manned.org/nsenter>.
- Run a specific command using the same namespaces as an existing process:
`nsenter --target {{pid}} --all {{command}} {{command_arguments}}`
- Run a specific command in an existing process's mount|UTS|IPC|network|PID|user|cgroup|time namespace:
`nsenter --target {{pid}} --{{mount|uts|ipc|net|pid|user|cgroup}} {{command}} {{command_arguments}}`
- Run a specific command in an existing process's UTS, time, and IPC namespaces:
`nsenter --target {{pid}} --uts --time --ipc -- {{command}} {{command_arguments}}`
- Run a specific command in an existing process's namespace by referencing procfs:
`nsenter --pid=/proc/{{pid}}/pid/net -- {{command}} {{command_arguments}}`