Easy Tutorial
❮ Linux Comm Lsattr Linux Comm Top ❯

Linux ulimit Command

Linux Command Manual

The Linux ulimit command is used to control the resources of shell programs.

ulimit is a shell built-in command that can be used to control the resources of shell programs.

Syntax

ulimit [-aHS][-c <core file limit>][-d <data segment size>][-f <file size>][-m <memory size>][-n <file number>][-p <buffer size>][-s <stack size>][-t <CPU time>][-u <process number>][-v <virtual memory size>]

Parameters:

Example

Display system resource settings

[root@tutorialpro ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
pending signals               (-i) 1024
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                   (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes           (-u) 4096
virtual memory          (kbytes, -v) unlimited
file locks                   (-x) unlimited
[root@tutorialpro ~]#

Set the upper limit of the number of single-user programs

[root@tutorialpro ~]# ulimit -u 500 //Set the upper limit of single-user programs
[root@tutorialpro ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
file size               (blocks, -f) unlimited
pending signals               (-i) 1024
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                   (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes           (-u) 500
virtual memory          (kbytes, -v) unlimited
file locks                   (-x) unlimited
[root@tutorialpro ~]#

Linux Command Manual

❮ Linux Comm Lsattr Linux Comm Top ❯