Run a specific command in an existing process's UTS, time, and IPC namespaces

nsenter

  • Run a new command in a running process' namespace.
    Particularly useful for docker images or chroot jails.
    More information: <https://manned.org/nsenter>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

nsenter --target {{pid}} --uts --time --ipc -- {{command}} {{command_arguments}}

click the source code to copy install nsenter on any operating system with command-not-found.com