The prctree C program searches for a specified process in the process tree rooted at a given process and outputs information based on the input parameters.
root_process is the PID of a process that is a descendant of a current BASH process. process_id is the PID of a process that is a descendant of a current BASH process.
- -c lists the PIDs of all the child processes (immediate descendants) of process_id
- -s lists the PID and PPID of all the sibling processes of process_id
- -gp lists the PID of the grandparent of process_id
- -gc lists the PIDs and PPIDs of all the grandchildren of process_id
- -z prints if process_id is DEFUNCT/NOT DEFUNCT
- -zl lists the PIDs of all the child processes of process_id that are currently in the defunct state
The ztree C program searches for defunct processes in the process tree rooted at a specified process and forcefully terminates the parent processes based on the input parameters.
root_process is the PID of a process that is a descendant of a current BASH process.
- -t forcefully terminates parent processes (whose elapsed time is greater than PROC_ELTIME) of all the defunct processes in the process tree rooted at root_process
- -b forcefully terminates all the processes in the process tree rooted at root_process that have NO_OF_DFCS defunct child processes.
- PROC_ELTIME is the elapsed time of the process in minutes since it was created (>=1)
- NO_OF_DFCS is the number of defunct child processes (>=1)