Update cheatsheets

This commit is contained in:
ivuorinen
2024-02-21 11:19:49 +00:00
parent 4e88a1b42f
commit 3d653cc7e6
4803 changed files with 127002 additions and 0 deletions

34
linux/nsenter Normal file
View File

@@ -0,0 +1,34 @@
---
syntax: markdown
tags: [tldr, linux]
source: https://github.com/tldr-pages/tldr.git
---
# 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 network namespace:
`nsenter --target {{pid}} --net {{command}} {{command_arguments}}`
- Run a specific command in an existing process's PID namespace:
`nsenter --target {{pid}} --pid {{command}} {{command_arguments}}`
- Run a specific command in an existing process's IPC namespace:
`nsenter --target {{pid}} --ipc {{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}}`