prlimit
prlimit is a command-line utility used to view and adjust the resource limits (rlimits) of a process on Linux and other Unix-like systems. It interacts with the kernel via the getrlimit and setrlimit interfaces, allowing administrators and developers to bound or inspect a process’s resource usage.
prlimit provides a convenient way to query the soft and hard limits for various resources, such as
Typical usage is prlimit [OPTIONS] [PID]. Common options include:
- -a, --all: display all resource limits for the target process
- -p, --pid PID: select a specific process by PID (default is the current process)
Limits are provided as resource=value pairs. Values can be a single number (applied to both soft and
- prlimit --pid 123 --nofile=1024:2048 sets the soft and hard limits for open files on process 123.
- prlimit -a displays all limits for the current process.
- prlimit --cpu=60 resets the CPU time limit for the current process.
Raising hard limits typically requires appropriate privileges; lowering limits is generally allowed for regular users within