Skip to content

Instantly share code, notes, and snippets.

@mikroskeem
Created December 10, 2014 21:36
Show Gist options
  • Save mikroskeem/aec01bcd71315c5eb590 to your computer and use it in GitHub Desktop.
Save mikroskeem/aec01bcd71315c5eb590 to your computer and use it in GitHub Desktop.
/proc cmdline viewer
import string, subprocess
proc = subprocess.Popen(["ls", "/proc"], stdout=subprocess.PIPE)
for k in proc.stdout.readlines():
itm = k[:-1].decode()
if set(itm) <= set(string.digits):
c = open("/proc/{}/cmdline".format(itm), 'r')
print(c.read())
c.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment