ulimit(1)


ulimit -- set or report file size limit

Synopsis

/usr/bin/ulimit [-f] [blocks]

/usr/bin/ulimit [-f] [unlimited]

Description

This shell script executes the builtin command of the same name as implemented by the /u95/bin/sh( ) shell. See ksh(1) for more information on this shell.

The ulimit command sets or reports the file size writing limit imposed on files written by the shell and its child processes (files of any size may be read). Only a process with appropriate privileges can increase the limit.

Command options

-f
Set (or report, if no blocks operand is present), the file size limit in blocks. The -f option is also the default case; that is, you can specify a number of blocks with or without the preceding -f option, and both cases are interpreted as an attempt to raise the file size limit.

Operands

blocks
The number of 512-byte blocks to use as the new file size limit.

unlimited
Set the largest valid file size limit. For large file aware filesystems, unlimited represents the largest file size for the filesystem.

Environment variables

The following environment variables affect the execution of ulimit:

LANG
Provide a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the implementation-specific default locale will be used. If any of the internationalization variables contains an invalid setting, the utility will behave as if none of the variables had been defined.

LC_ALL
If set to a non-empty string value, override the values of all the other internationalization variables.

LC_CTYPE
Determine the locale for the interpretation of sequences of bytes of text data as characters (for example, single- as opposed to multi-byte characters in arguments).

LC_MESSAGES
Determine the locale that should be used to affect the format and contents of diagnostic messages written to standard error.

Output

The standard output is used when no blocks operand is present. If the current number of blocks is limited, the number of blocks in the current limit is written to standard output.

Exit codes

An exit code of ``0''indictes successful completion; an exit code greater than ``0'' indicates that a request for a higher limit was rejected or an error occurred.

Usage

Since ulimit affects the current shell execution environment, if it is called in a separate utility execution environment, such as one of the following:
   nohup ulimit -f 10000 
   env ulimit 10000 
it will not affect the file size limit of the caller's environment.

Once a limit has been decreased by a process, it cannot be increased (unless appropriate privileges are involved), even back to the original system limit.

Examples

Set the file size limit to 51,200 bytes:
   ulimit -f 100 

References

ksh(1), ulimit(2).

Notices

Considerations for large file support

Large files are supported only on vxfs type file systems. While files larger than 2 gigabytes are supported on such file systems, the file size limit for a process cannot be raised above 2 gigabytes from the command line. Executing the command:
   ulimit -f unlimited 
on a default vxfs file system sets the file size limit to 4194303 blocks (2 gigabytes). A file size limit larger than 2 gigabytes can be set using the ulimit(2) or getrlimit(2) system calls.
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.