import glob,os
seen=set()
for pid in sorted(glob.glob('/proc/[0-9]*'), key=lambda x:int(x.split('/')[-1])):
    pid=pid.split('/')[-1]
    try:
        with open('/proc/'+pid+'/cmdline','rb') as f: cl=f.read().replace(b'\x00',b' ').decode(errors='replace')
    except: continue
    cl=cl.strip()
    if not cl: continue
    # skip known harmless
    print(pid, cl)
