Skip to content

Instantly share code, notes, and snippets.

@wanzixyz
wanzixyz / list-namespace.py
Last active November 21, 2019 06:28
list namespace
#!/usr/bin/env python
#coding=utf-8
import os
import re
#format: pid, [namespaces], cmdline
def _get_namespace(pid):
path = '/proc/{0}/ns/'.format(pid)
namespaces = []