Generating a process list without ps



Published: 2017-12-11 14:48:55 +0000
Categories: BASH,

Language

BASH

Description

On occasion you may need to generate a process list without using "ps" (because you believe it's been compromised in some way)

This snippet will generate basic output giving PID and process details

Similar to

  • ps

Snippet

for i in `ls -1 /proc/ | egrep "([0-9]+)"`
do
    echo "$i:[`cat /proc/$i/comm`] `cat /proc/$i/cmdline`"
done

Keywords

ps, process list, running processes, PID, command,

Latest Posts


Copyright © 2019 Ben Tasker | Sitemap | Privacy Policy
Available at snippets.bentasker.co.uk, yr4pnhounvdybotb.onion and snippets.6zdgh5a5e6zpchdz.onion