Linux – Display Only Non-Kernel Processes with ps

filterlinuxlinux-kernelprocessps

How can I ask ps to display only user processes and not kernel threads?

See this question to see what I mean…

Best Answer

This should do (under Linux):

ps --ppid 2 -p 2 --deselect

kthreadd (PID 2) has PPID 0 (on Linux 2.6+) but ps does not allow to filter for PPID 0; thus this work-around.