LIMIT(1) | User Commands | LIMIT(1) |
/usr/bin/ulimit [-f] [blocks]
ulimit [- [HS] [a | cdfnstv]]
ulimit [- [HS] [c | d | f | n | s | t | v]] limit
limit [-h] [resource [limit]]
unlimit [-h] [resource]
ulimit [-HSacdfnstv] [limit]
ulimit [-HSacdfmnpstv] [limit]
If limit is not present, ulimit prints the specified limits. Any number of limits can be printed at one time. The -a option prints all limits.
If limit is present, ulimit sets the specified limit to limit. The string unlimited requests that the current limit, if any, be removed. Any user can set a soft limit to any value less than or equal to the hard limit. Any user can lower a hard limit. Only a user with appropriate privileges can raise or remove a hard limit. See getrlimit(2).
The -H option specifies a hard limit. The -S option specifies a soft limit. If neither option is specified, ulimit sets both limits and prints the soft limit.
The following options specify the resource whose limits are to be printed or set. If no option is specified, the file size limit is printed or set.
-c
-d
-f
-n
-s
-t
-v
-h
resource is one of:
cputime
filesize
datasize
stacksize
coredumpsize
descriptors
memorysize
limit is a number, with an optional scaling factor, as follows:
nh
nk
nm
mm:ss
unlimit removes a limitation on resource. If no resource is specified, then all resource limitations are removed. See the description of the limit command for the list of resource names.
-h
-a
-c
-d
-f
-n
-s
-t
-v
If no option is specified, -f is assumed.
Increasing the limit for a resource usually requires special privileges. Some systems allow you to lower resource limits and later increase them. These are called soft limits. Once a hard limit is set the resource cannot be increased.
Different systems allow you to specify different resources and some restrict how much you can raise the limit of the resource.
The value of limit depends on the unit of the resource listed for each resource. In addition, limit can be "unlimited" to indicate no limit for that resource.
If you do not specify -H or -S, -S is used for listing and both -S and -H are used for setting resources.
If you do not specify any resource, the default is -f.
The following options are available for ulimit in ksh93:
-a
-b
--sbsize
-c
--core
-d
--data
-f
--fsize
-H
-L
--locks
-l
--memlock
-M
--as
-n
--nofile
-p
--pipe
-m
--rss
-S
-s
--stack
-T
--threads
-t
--cpu
-u
--nproc
-v
--vmem
-f
blocks
The following example limits the stack size to 512 kilobytes:
example% ulimit -s 512 example% ulimit -a time(seconds) unlimited file(blocks) 100 data(kbytes) 523256 stack(kbytes) 512 coredump(blocks) 200 nofiles(descriptors) 64 memory(kbytes) unlimited
The following command limits the number of file descriptors to 12:
example$ ulimit -n 12 example$ ulimit -a time(seconds) unlimited file(blocks) 41943 data(kbytes) 523256 stack(kbytes) 8192 coredump(blocks) 200 nofiles(descriptors) 12 vmemory(kbytes) unlimited
The following command limits the size of a core dump file size to 0 kilobytes:
example% limit coredumpsize 0 example% limit cputime unlimited filesize unlimited datasize 523256 kbytes stacksize 8192 kbytes coredumpsize 0 kbytes descriptors 64 memorysize unlimited
Example 4 Removing the limitation for core file size
The following command removes the above limitation for the core file size:
example% unlimit coredumpsize example% limit cputime unlimited filesize unlimited datasize 523256 kbytes stacksize 8192 kbytes coredumpsize unlimited descriptors 64 memorysize unlimited
0
>0
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Committed |
Standard | See standards(7). |
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | Uncommitted |
September 12, 2020 | OmniOS |