Container Basics On Linux (Namespaces/Cgroups)
Stop wondering which namespace your process is hiding in
đź§© The Challenge
Dealing with container isolation is great until you’re trying to debug a process and realize you have no idea which PID or network namespace it’s actually stuck in. I’ve wasted way too much time grepping through process lists that didn’t show me the full picture.
đź’ˇ The Fix
Use the lsns command to list all the namespaces on your host so you can see who is isolated from what. It saves you from guessing why a process can’t see the interfaces you think it should be using.
lsns -t net,pid
⚙️ Why It Works
By filtering specifically for network and process namespaces, you get a quick mapping of which processes belong to which isolation boundaries without the noise of every other namespace type.
🚀 Pro-Tip: Pipe it into column -t if you’re dealing with a system that has hundreds of containers running, otherwise the output will just be a mess.
Linux Tips & Tricks | © ngelinux.com | 12/5/2026
