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

Remotely backing up PFsense Configuration (BASH)
FFMPEG: Converting RMVB to X264 MP4 (BASH)
Recursively print table (print_r equivalent) (LUA)
Bulk Delete Comments from (Self-Hosted) JIRA Issues (Misc)
Add a static entry to the ARP table (BASH)
SSL Cipher Hex codes to Human Readable Names (Misc)
Convert Ascii to Binary (BASH)
Intercepting Outbound DNS Queries (BASH)
Handle Google Verification files within NGinx Configuration (NGinx)
Getting WhatsApp Rich Snippet Previews Working (Misc)

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