-proc -[0-9]+-status
The /proc/[PID]/status
file in Linux provides detailed information about a process, where [PID]
is the process ID of a running process. It contains various fields that describe the status of the process, such as memory usage, state, and other statistics.
Here's a breakdown of the contents and some of the common fields you will find in the /proc/[PID]/status
file:
Common Fields in /proc/[PID]/status
/proc/[PID]/status
Name
The name of the process.
Example:
Name: bash
Pid
The Process ID (PID) of the process.
Example:
Pid: 1234
PPid
The Parent Process ID (PPID), which is the PID of the process that started this process.
Example:
PPid: 5678
Uid
User ID (UID) of the process owner.
Example:
Uid: 1000 1000 1000 1000
Gid
Group ID (GID) of the process.
Example:
Gid: 1000 1000 1000 1000
VmSize
The total virtual memory size of the process in kilobytes.
Example:
VmSize: 10240 kB
VmRSS
The resident set size (RSS), which is the non-swapped physical memory the process uses, in kilobytes.
Example:
VmRSS: 2048 kB
State
The state of the process. This can be one of the following:
R
: RunningS
: SleepingD
: Waiting for I/OZ
: ZombieT
: StoppedW
: Paging
Example:
State: S (sleeping)
Tgid
Thread Group ID. For multithreaded processes, this is the PID of the first thread.
Example:
Tgid: 1234
Threads
The number of threads currently being used by the process.
Example:
Threads: 2
TracerPid
The PID of the process tracing this one (if any).
Example:
TracerPid: 0
FDSize
The number of file descriptors the process has opened.
Example:
FDSize: 64
SigQ
The number of pending signals for the process.
Example:
SigQ: 0/123
CapInh
Inherited capabilities for the process.
Example:
CapInh: 00000000
CapPrm
Effective capabilities for the process.
Example:
CapPrm: 00000000
CapEff
The process’s current capabilities.
Example:
CapEff: 00000000
Seccomp
The process's seccomp filter mode.
Example:
Seccomp: 0
Cpus_allowed
A bitmask of CPUs on which the process can run.
Example:
Cpus_allowed: 00000001
Cpus_allowed_list
A more readable format of CPUs allowed.
Example:
Cpus_allowed_list: 0
Mems_allowed
A bitmask of memory nodes that the process can use.
Example:
Mems_allowed: 00000001
Example of /proc/[PID]/status
/proc/[PID]/status
Usage
You can use a regular expression like -proc -[0-9]+-status
to find and parse the status
files for processes, where:
/proc/[PID]/status
contains the status information of the process with IDPID
.The
[0-9]+
part of the regular expression will match any process ID, so it can be used to find all status files in the/proc
directory.
For example, to view the status
of a process with PID 1234:
This gives a comprehensive snapshot of the process, useful for monitoring system performance, debugging, or gaining insight into process behavior.
Last updated