Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I see in examples, that the Option -u is used, but I cannot find a documentation, that says what that option means. man ulimit shows the manual for a C-function. What options has ulimit and what does they mean?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

The ulimit command is a built-in command which use the C functions described by man: It's own help is included in Bash man page, accessible with man bash.

You can list all available options with ulimit -h, and see their corresponding meaning using ulimit -a which list all available types of limitations and their current values, depending of your system:

core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 20
file size               (blocks, -f) unlimited
pending signals                 (-i) 16382
max locked memory       (kbytes, -l) 64
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) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) unlimited
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
share|improve this answer
add comment

ulimit has to be a shell built-in since the limit it establishes applies to the shell itself as well as the programs it starts. The only portable argument is -f (file size limit, in 512-byte units). Most shells have more option, you'll need to check the shell documentation to know exactly what they are. With portable shells such as bash and ksh, some unix variants may not support a limit even if the corresponding option is recognized by the shell.

Options that are supported by every shell I've seen:

  • -H: Combine with other options to set or show the hard limit only.
  • -S: Combine with other options to set or show the soft limit only.
  • -c: maximum core file size (512-byte blocks)
  • -d: maximum heap (data segment) size (kB)
  • -f: maximum file size (512-byte blocks)
  • -n: maximum number of file descriptors
  • -s: maximum stack size (kB)
  • -t: maximum CPU time (s)

A few other very common options:

  • -a: Display all limits.
  • -m: maximum physical memory size (kB)
  • -v: maximum virtual memory size (kB)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.