1ULIMIT(P) POSIX Programmer's Manual ULIMIT(P)
2
3
4
6 ulimit - set or report file size limit
7
9 ulimit [-f][blocks]
10
12 The ulimit utility shall set or report the file-size writing limit
13 imposed on files written by the shell and its child processes (files of
14 any size may be read). Only a process with appropriate privileges can
15 increase the limit.
16
18 The ulimit utility shall conform to the Base Definitions volume of
19 IEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines.
20
21 The following option shall be supported:
22
23 -f Set (or report, if no blocks operand is present), the file size
24 limit in blocks. The -f option shall also be the default case.
25
26
28 The following operand shall be supported:
29
30 blocks The number of 512-byte blocks to use as the new file size limit.
31
32
34 Not used.
35
37 None.
38
40 The following environment variables shall affect the execution of
41 ulimit:
42
43 LANG Provide a default value for the internationalization variables
44 that are unset or null. (See the Base Definitions volume of
45 IEEE Std 1003.1-2001, Section 8.2, Internationalization Vari‐
46 ables for the precedence of internationalization variables used
47 to determine the values of locale categories.)
48
49 LC_ALL If set to a non-empty string value, override the values of all
50 the other internationalization variables.
51
52 LC_CTYPE
53 Determine the locale for the interpretation of sequences of
54 bytes of text data as characters (for example, single-byte as
55 opposed to multi-byte characters in arguments).
56
57 LC_MESSAGES
58 Determine the locale that should be used to affect the format
59 and contents of diagnostic messages written to standard error.
60
61 NLSPATH
62 Determine the location of message catalogs for the processing of
63 LC_MESSAGES .
64
65
67 Default.
68
70 The standard output shall be used when no blocks operand is present. If
71 the current number of blocks is limited, the number of blocks in the
72 current limit shall be written in the following format:
73
74
75 "%d\n", <number of 512-byte blocks>
76
77 If there is no current limit on the number of blocks, in the POSIX
78 locale the following format shall be used:
79
80
81 "unlimited\n"
82
84 The standard error shall be used only for diagnostic messages.
85
87 None.
88
90 None.
91
93 The following exit values shall be returned:
94
95 0 Successful completion.
96
97 >0 A request for a higher limit was rejected or an error occurred.
98
99
101 Default.
102
103 The following sections are informative.
104
106 Since ulimit affects the current shell execution environment, it is
107 always provided as a shell regular built-in. If it is called in a sepa‐
108 rate utility execution environment, such as one of the following:
109
110
111 nohup ulimit -f 10000
112 env ulimit 10000
113
114 it does not affect the file size limit of the caller's environment.
115
116 Once a limit has been decreased by a process, it cannot be increased
117 (unless appropriate privileges are involved), even back to the original
118 system limit.
119
121 Set the file size limit to 51200 bytes:
122
123
124 ulimit -f 100
125
127 None.
128
130 None.
131
133 The System Interfaces volume of IEEE Std 1003.1-2001, ulimit()
134
136 Portions of this text are reprinted and reproduced in electronic form
137 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
138 -- Portable Operating System Interface (POSIX), The Open Group Base
139 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
140 Electrical and Electronics Engineers, Inc and The Open Group. In the
141 event of any discrepancy between this version and the original IEEE and
142 The Open Group Standard, the original IEEE and The Open Group Standard
143 is the referee document. The original Standard can be obtained online
144 at http://www.opengroup.org/unix/online.html .
145
146
147
148IEEE/The Open Group 2003 ULIMIT(P)