Skip to content

Tag: ps

Grandchildren and Great-grandchildren of a process

I am trying to get the grandchildren and grand grandchildren PID’S of a certain PID that I pass as an argument. So, I am trying to find the simplest solution possible for a beginner. Now, I used pgrep -P $pid, to find the children of a certain PID, but now that I want to go even deeper, I think I

Find out the shell which was used to run the process in linux?

I recently got stuck in a situation where I need to find out the name of the shell for a list of process (or for a single process, using pid). Is there a way we can find it out (preferably using ps and grep command). Answer Since you know that the processes have been started from a shell, you just

ps command -o option gives “ERROR: Garbage option”

I have 2 suse-11 machine both has same kernel version. Linux version 2.6.32.59-0.7-default (geeko@buildhost) (gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) ) #1 SMP 2012-07-13 15:50:56 +0200 but in one machine below command works ps -u test-o ‘%U %p %P %c’ but in other gives erro…