See exactly where your process lives in the namespace hierarchy

Container Basics On Linux (Namespaces/Cgroups)

See exactly where your process lives in the namespace hierarchy

🧩 The Challenge

Trying to figure out why a process is acting like it’s in a different universe, but you can’t tell if it’s actually sandboxed or just configured poorly. I’ve wasted way too much time guessing which mount or PID namespace a containerized app thinks it’s in.

💡 The Fix

You can use the readlink command on the namespace files inside the proc filesystem to see the unique ID for each namespace type. It’s the fastest way to confirm if two processes are truly isolated or just pretending to be.

ls -l /proc/<PID>/ns/

⚙️ Why It Works

Each entry in that directory points to a specific namespace; if two processes share the same inode number for a specific type like net or mnt, they’re definitely living in the same isolated environment.

🚀 Pro-Tip: Pipe it into readlink -f if you want to see the literal ID without the extra symlink noise.

Linux Tips & Tricks | © ngelinux.com | 9/19/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted