Explore Processes

From mylearnings
Revision as of 11:05, 16 June 2025 by Pristal (talk | contribs) (Created page with "* Find PID of a known program. <pre> pidof <application name> </pre> * Find all the direct and indirect child processes of a process. <pre> pstree -p <PID> </pre> * List all the files opened by a process with PID. <pre> lsof -p <PID> </pre> * Find details of a file descriptor corresponding to a PID. <pre> lsof -p <PID> -a -d <FD> </pre> ::- -a => Stands for 'AND' Operation. ::- -d => File descriptor for which we need to find details. * Find Parent (PPID) of a process...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
  • Find PID of a known program.
pidof <application name>
  • Find all the direct and indirect child processes of a process.
pstree -p <PID>
  • List all the files opened by a process with PID.
lsof -p <PID>
  • Find details of a file descriptor corresponding to a PID.
lsof -p <PID> -a -d <FD>
- -a => Stands for 'AND' Operation.
- -d => File descriptor for which we need to find details.
  • Find Parent (PPID) of a process with PID.
ps -o ppid= -o comm= -p <PID>
- -o ppid= => Will print PPID in the output.
- -o comm= => Will print command in the output.
  • Find which all processes have opened a particular file.
fuser -cv <file>
  • See all the threads of a process.
ls /proc/<PID>/task/
  • See details about all the child process
ps --ppid <PID> -o pid,state,tname,time,command