The ulimit built-in sets or prints a resource limit.


  • ulimit -a [-H|-S]

  • ulimit [-H|-S] [-efilnqrstuvx] [limit]


The ulimit built-in sets or prints a resource limit.

If executed with the -a (--all) option, the built-in prints the current limits for all resource types. Otherwise, it sets or prints the limit of a single resource type. The resource type can be specified by the options listed below. The resource limits will affect the current shell process and all commands invoked from the shell.

Each resource type has two limit values: the hard and soft limit. You can change a soft limit freely as long as it does not exceed the hard limit. You can decrease a hard limit but cannot increase it without a proper permission.

When the -H (--hard) or -S (--soft) option is specified, the built-in sets or prints the hard or soft limit, respectively. If neither of the options is specified, the built-in sets both the hard and soft limit or prints the soft limit.



Set or print a hard limit.


Set or print a soft limit.


Print all current limit settings.

The following options specify the type of resources. If none of them is specified, -f is the default. The types of resources that can be set depend on the operating system.


Maximum size of core files created (in 512-byte blocks)


Maximum size of a process’s data segment (in kilobytes)


Maximum scheduling priority (‘nice’)


Maximum size of files created by a process (in 512-byte blocks)


Maximum number of pending signals


Maximum memory size that can be locked into RAM (in kilobytes)


Maximum size of a process’s resident set (in kilobytes)


Maximum file descriptor + 1


Maximum size of POSIX message queues


Maximum real-time scheduling priority


Maximum size of a process’s stack (in kilobytes)


Maximum CPU time that can be used by a process (in seconds)


Maximum number of processes for a user


Maximum size of memory used by a process (in kilobytes)


Maximum number of file locks



A limit to be set.

The value must be a non-negative integer or one of hard, soft, and unlimited. If value is hard or soft, the new limit is set to the current hard or soft limit. If limit is not specified, the current limit is printed.

Exit status

The exit status of the ulimit built-in is zero unless there is any error.


The POSIX standard defines no options other than -f. It neither defines hard, soft, or unlimited for limit values.

The ulimit built-in is a semi-special built-in.