English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Linux ulimit command

Linux-Befehls大全

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

ulimit is an in-built command of the shell, used to control the resources of the shell executing programs.

Syntax

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

Parameters:

  • -a Display the current settings of resource limits.
  • -c <core file limit> Set the maximum value of core files, unit is blocks.
  • -d <data section size> The maximum value of the program data section, unit is KB.
  • -f <file size> The maximum file that the shell can create, unit is blocks.
  • -H Set the hard limit of resources, which is the limit set by the administrator.
  • -m <memory size> Specify the maximum limit of available memory, unit is KB.
  • -n <number of files> Specify the maximum number of files that can be opened at the same time.
  • -p <buffer size> Specify the size of the pipe buffer, unit512Bytes.
  • -s <stack size> Specify the maximum limit of stack, unit is KB.
  • -S Set the elastic limit of resources.
  • -t <CPU time> Specify the maximum limit of CPU usage time, unit is seconds.
  • -u <number of programs> The maximum number of programs a user can open.
  • -v <virtual memory size> Specify the maximum limit of available virtual memory, unit is KB.

Online examples

Display the settings of system resources

[[email protected] ~]# ulimit -a
Größe der Core-Datei     (Blöcke, -c) 0
Größe des Datensegments      (kbytes, -d) unbegrenzt
Dateigröße        (Blöcke, -f) unbegrenzt
ausstehende Signale         (-i) 1024
maximale gesperrte Speichergröße    (kbytes, -l) 32
maximale Speichergröße     (kbytes, -m) unbegrenzt
Offene Dateien           (-n) 1024
Rohrgröße      (512 Bytes, -p) 8
POSIX-Nachrichtenqueues   (Bytes, -q) 819200
Stackgröße       (kbytes, -s) 10240
CPU-Zeit        (Sekunden, -t) unbegrenzt
maximale Benutzerprozesse       (-u) 4096
Virtueller Speicher     (kbytes, -v) unbegrenzt
Dateisperren           (-x) unbegrenzt
[[email protected] ~]# 

Set the maximum number of single user programs

[[email protected] ~]# ulimit -u 500 //Einstellen der Obergrenzen für ein Benutzerprogramm
[[email protected] ~]# ulimit -a
Größe der Core-Datei     (Blöcke, -c) 0
Größe des Datensegments      (kbytes, -d) unbegrenzt
Dateigröße        (Blöcke, -f) unbegrenzt
ausstehende Signale         (-i) 1024
maximale gesperrte Speichergröße    (kbytes, -l) 32
maximale Speichergröße     (kbytes, -m) unbegrenzt
Offene Dateien           (-n) 1024
Rohrgröße      (512 Bytes, -p) 8
POSIX-Nachrichtenqueues   (Bytes, -q) 819200
Stackgröße       (kbytes, -s) 10240
CPU-Zeit        (Sekunden, -t) unbegrenzt
maximale Benutzerprozesse       (-u) 500
Virtueller Speicher     (kbytes, -v) unbegrenzt
Dateisperren           (-x) unbegrenzt
[[email protected] ~]# 

Linux-Befehls大全