Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Linux ulimit Command

Linux ulimit Command

Linux Command Reference Linux Command Reference

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 programs executed by the shell.

Syntax



ulimit [-aHS][-c ][-d <数据节区大小>][-f <文件大小>][-m <内存大小>][-n <文件数目>][-p <缓冲区大小>][-s <堆叠大小>][-t ][-u <程序数目>][-v <虚拟内存大小>]

Parameters:

Example

Display system resource settings



[root@runoob ~]# 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@runoob ~]# 

Set the upper limit on the number of processes per user



[root@runoob ~]# ulimit -u 500 //设置单一用户程序上限

[root@runoob ~]# 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@runoob ~]# 

Linux Command Reference Linux Command Reference