Created
December 10, 2014 21:36
-
-
Save mikroskeem/aec01bcd71315c5eb590 to your computer and use it in GitHub Desktop.
/proc cmdline viewer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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