proc:status_file
This is an old revision of the document!
Proc - Status file
To get the status information of a process, all you have to do is read the file /proc/PID/status:
cat /proc/self/status
returns:
Name: cat State: R (running) Tgid: 5452 Pid: 5452 PPid: 743 TracerPid: 0 (2.4) Uid: 501 501 501 501 Gid: 100 100 100 100 FDSize: 256 Groups: 100 14 16 VmPeak: 5004 kB VmSize: 5004 kB VmLck: 0 kB VmHWM: 476 kB VmRSS: 476 kB VmData: 156 kB VmStk: 88 kB VmExe: 68 kB VmLib: 1412 kB VmPTE: 20 kb VmSwap: 0 kB Threads: 1 SigQ: 0/28578 SigPnd: 0000000000000000 ShdPnd: 0000000000000000 SigBlk: 0000000000000000 SigIgn: 0000000000000000 SigCgt: 0000000000000000 CapInh: 00000000fffffeff CapPrm: 0000000000000000 CapEff: 0000000000000000 CapBnd: ffffffffffffffff voluntary_ctxt_switches: 0 nonvoluntary_ctxt_switches: 1
This shows you nearly the same information you would get if you viewed it with the ps command. In fact, ps uses the proc file system to obtain its information. But you get a more detailed view of the process by reading the file /proc/PID/status.
proc/status_file.1491385567.txt.gz · Last modified: 2020/07/15 09:30 (external edit)