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
Tag: ps
Why am I not able to use -o or –format with ps command to control the output format?
I want to print certain columns only from ps output that is PID, PPID, command, memory utilization and CPU utilization columns. when I run ps command I get the following output. Now I only want some columns from this output so I use -o flag as mentioned in this tutorial. But I am getting this error. I don’t understand where
how to redirect ps command in linux to look into other folder than /proc
I am using docker containers and I have mounted host /proc to container /host/proc. Now I want ps command inside docker container to look for processes into /host/proc instead of /proc. or how can I right similar utility to ps Answer the /proc path is hardcoded in the source tree of the /bin/ps binary file. Thus, you need to recompile
How do I match and kill a specific process without accidentally including unrelated processes?
I have two Tomcat processes, one is called event-ws, another is called app-event-ws. I sometimes need to kill event-ws from a shell script: The above will find and kill both of them; how can I find exactly find one of them? Answer pgrep / pkill are the best tools to use in this case, instead of ps: Each command matches
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
bash process monitor script echo empty when no process found
I’ve created a process monitor to check for the presence of a running process, and if found we need to check its parent to determine if it is acceptable or not, it’s a security check basically. It works great when I look for running processes and gives me output that I expect. However, for some reason when no process is
How are the number various ulimit values for a process set? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question
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 error like below Really not able to figure what is the problem here, can