Contained WithinFind More DocumentationFeatured Support Resources | Download this book in PDF (7229 KB)
ulimit(1)Name | Synopsis | Description | Options | Operands | Examples | Environment Variables | Exit Status | Attributes | See Also Name
Synopsis/usr/bin/ulimit [-f] [blocks] shulimit [- [HS] [a | cdfnstv]] ulimit [- [HS] [c | d | f | n | s | t | v]] limit cshlimit [-h] [resource [limit]] unlimit [-h] [resource] kshulimit [-HSacdfnstv] [limit] ksh93ulimit [-HSacdfmnpstv] [limit] Description
/usr/bin/ulimitThe ulimit utility sets or reports the file-size writing limit imposed on files written by the shell and its child processes (files of any size can be read). Only a process with appropriate privileges can increase the limit. shThe Bourne shell built-in function, ulimit, prints or sets hard or soft resource limits. These limits are described in getrlimit(2). 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 tolimit. 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. cshThe C-shell built-in function, limit, limits the consumption by the current process or any process it spawns, each not to exceed limit on the specified resource. The string unlimited requests that the current limit, if any, be removed. If limit is omitted, prints the current limit. If resource is omitted, displays all limits. resource is one of: limit is a number, with an optional scaling factor, as follows: 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. kshThe Korn shell built-in function, ulimit, sets or displays a resource limit. The available resources limits are listed below. Many systems do not contain one or more of these limits. The limit for a specified resource is set when limit is specified. The value of limit can be a number in the unit specified below with each resource, or the value unlimited. The string unlimited requests that the current limit, if any, be removed. The -H and -S flags specify whether the hard limit or the soft limit for the specified resource is set. A hard limit cannot be increased once it is set. A soft limit can be increased up to the value of the hard limit. If neither the -H or -S options is specified, the limit applies to both. The current resource limit is printed when limit is omitted. In this case, the soft limit is printed unless -H is specified. When more than one resource is specified, then the limit name and unit is printed before the value. If no option is specified, -f is assumed. Per-Shell Memory ParametersThe heapsize, datasize, and stacksize parameters are not system tunables. The only controls for these are hard limits, set in a shell startup file, or system-wide soft limits, which, for the current version of the Solaris OS, is 264bytes. ksh93ulimit sets or displays resource limits. These limits apply to the current process and to each child process created after the resource limit has been set. If limit is specified, the resource limit is set, otherwise, its current value is displayed on standard output. 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: Options
The following option is supported by /usr/bin/ulimit: Operands
The following operand is supported by /usr/bin/ulimit: Examples/usr/bin/ulimitExample 1 Limiting the Stack SizeThe following example limits the stack size to 512 kilobytes:
sh/kshExample 2 Limiting the Number of File DescriptorsThe following command limits the number of file descriptors to 12:
cshExample 3 Limiting the Core Dump File SizeThe following command limits the size of a core dump file size to 0 kilobytes:
Example 4 Removing the limitation for core file sizeThe following command removes the above limitation for the core file size:
Environment VariablesSee environ(5) for descriptions of the following environment variables that affect the execution of ulimit: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. Exit Status
The following exit values are returned by ulimit: AttributesSee attributes(5) for descriptions of the following attributes: /usr/bin/ulimit, csh, ksh, sh
ksh93See Alsobc(1), csh(1), ksh(1), ksh93(1), sh(1), df(1M), su(1M), swap(1M), sysdef(1M), getrlimit(2), attributes(5), environ(5), standards(5) Name | Synopsis | Description | Options | Operands | Examples | Environment Variables | Exit Status | Attributes | See Also |
||||||||||||