1

I am trying to list the superusers processes currently running in my Kali distro. Using "pgrep -f sbin" I figured that would do the trick, however it only lists the PID numbers, not the actual name of the processes. How can I get it to do this?

Using "ps ef | grep "sbin" it returns a very unformatted list, is there a neat way to format this or dump it to a textfile with some proper formation?

3

Have you tried adding -u root to the ps command?

This will limit it to just roots processes. i.e. ps -ef -u root | grep sbin.

To control the output you need to look at the OUTPUT FORMAT CONTROL section in the man pages. Just play with the flags until you get the desired/acceptable output?

| improve this answer | |
0

Solved it by adding the -l flag to pgrep:

pgrep -lf sbin

From man pgrep:

   -l, --list-name
          List the process name as well as the process ID.  (pgrep only.)
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.