prlimit Command Examples in Linux

The prlimit command is a Linux utility that allows users to view and modify the resource limits for a given process. On a Linux system, various resources such as memory, CPU time, number of files, and open file descriptors are allocated to each process. These limits are in place to prevent a single process from consuming too many system resources and affecting the overall performance and stability of the system.

With prlimit, you can get or set the soft and hard limits for one or more resources associated with a specific process ID. The “soft limit” is the current limit of the resource that the process is allowed to use, while the “hard limit” is the maximum limit that the process can be raised to.

prlimit Command Examples

1. Display limit values for all current resources for the running parent process:

# prlimit

2. Display limit values for all current resources of a specified process:

# prlimit --pid pid number

3. Run a command with a custom number of open files limit:

# prlimit --nofile=10 command
Related Post