YouTip LogoYouTip

Linux Comm Ulimit

Linux ulimit Command

Linux ulimit Command

-- Learning is not just about technology, but also about dreams!

Linux Tutorial

Linux Tutorial Linux Introduction Linux Installation Linux Cloud Server Install Linux on WSL Linux System Boot Process Linux System Directory Structure Linux Forgot Password Solution Linux Remote Login Linux File Basic Attributes Linux File and Directory Management Linux Users and Groups Management Linux Disk Management Linux vi/vim linux yum command Linux apt command

Shell Tutorial

Shell Tutorial Shell Variables Shell Passing Arguments Shell Arrays Shell Operators Shell echo command Shell printf command Shell test command Shell Process Control Shell Functions Shell Input/Output Redirection Shell File Inclusion

Linux Reference Manual

Linux Command Manual Nginx Installation and Configuration MySQL Installation and Configuration Linux Quiz

Shell File Inclusion Shell File Inclusion

Nginx Installation and Configuration

Linux ulimit Command

Linux Command Manual Linux Command Manual

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

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

Syntax

ulimit [-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:

  • -a Display current resource limit settings.
  • -c <core file limit> Set the maximum size of core files, in blocks.
  • -d <data segment size> Maximum size of program data segment, in KB.
  • -f <file size> The largest file that the shell can create, in blocks.
  • -H Set the hard limit of resources, which are limits set by the administrator.
  • -m <memory size> Specify the upper limit of usable memory, in KB.
  • -n <file number> Specify the maximum number of files that can be opened at the same time.
  • -p <buffer size> Specify the pipe buffer size, in units of 512 bytes.
  • -s <stack size> Specify the stack size limit, in KB.
  • -S Set the soft limit for resources.
  • -t <CPU time> Specify the upper limit of CPU usage time, in seconds.
  • -u <process number> The maximum number of processes a user can start.
  • -v <virtual memory size> Specify the upper limit of usable virtual memory, in KB.

Examples

Display system resource settings

[root@ ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
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
real-time priority              (-r) 0
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@ ~]# 

Set the upper limit of processes for a single user

[root@ ~]# ulimit -u 500 //Set the upper limit of processes for a single user
[root@ ~]# ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
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
real-time priority              (-r) 0
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@ ~]# 

Linux Command Manual Linux Command Manual

Shell File Inclusion Shell File Inclusion

Nginx Installation and Configuration

iFlytek Star Coding Plan includes free model call quotas for DeepSeek, GLM, Kimi, MiniMax, a one-stop experience and deployment platform. Configuration Guide Β₯3.9/month Activate Now

Click to Share Notes

Cancel

Write notes...

Image URL

Image Description

Image Size Γ—

Share Notes

  • Nickname Nickname (Required)
  • Email Email (Required)
  • Reference URL Reference URL

Category Navigation

← Os CloserangeOs Close β†’