1ULIMIT(1P)                 POSIX Programmer's Manual                ULIMIT(1P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       ulimit — set or report file size limit
13

SYNOPSIS

15       ulimit [-f] [blocks]
16

DESCRIPTION

18       The ulimit utility shall set or  report  the  file-size  writing  limit
19       imposed on files written by the shell and its child processes (files of
20       any size may be read). Only a process with appropriate  privileges  can
21       increase the limit.
22

OPTIONS

24       The  ulimit  utility  shall  conform  to the Base Definitions volume of
25       POSIX.1‐2017, Section 12.2, Utility Syntax Guidelines.
26
27       The following option shall be supported:
28
29       -f        Set (or report, if no blocks operand is  present),  the  file
30                 size limit in blocks. The -f option shall also be the default
31                 case.
32

OPERANDS

34       The following operand shall be supported:
35
36       blocks    The number of 512-byte blocks to use as  the  new  file  size
37                 limit.
38

STDIN

40       Not used.
41

INPUT FILES

43       None.
44

ENVIRONMENT VARIABLES

46       The  following  environment  variables  shall  affect  the execution of
47       ulimit:
48
49       LANG      Provide a default value for  the  internationalization  vari‐
50                 ables  that are unset or null. (See the Base Definitions vol‐
51                 ume of POSIX.1‐2017, Section 8.2, Internationalization  Vari‐
52                 ables  for  the  precedence of internationalization variables
53                 used to determine the values of locale categories.)
54
55       LC_ALL    If set to a non-empty string value, override  the  values  of
56                 all the other internationalization variables.
57
58       LC_CTYPE  Determine  the  locale for the interpretation of sequences of
59                 bytes of text data as characters (for example, single-byte as
60                 opposed to multi-byte characters in arguments).
61
62       LC_MESSAGES
63                 Determine the locale that should be used to affect the format
64                 and contents  of  diagnostic  messages  written  to  standard
65                 error.
66
67       NLSPATH   Determine the location of message catalogs for the processing
68                 of LC_MESSAGES.
69

ASYNCHRONOUS EVENTS

71       Default.
72

STDOUT

74       The standard output shall be used when no blocks operand is present. If
75       the  current  number  of blocks is limited, the number of blocks in the
76       current limit shall be written in the following format:
77
78
79           "%d\n", <number of 512-byte blocks>
80
81       If there is no current limit on the number  of  blocks,  in  the  POSIX
82       locale the following format shall be used:
83
84
85           "unlimited\n"
86

STDERR

88       The standard error shall be used only for diagnostic messages.
89

OUTPUT FILES

91       None.
92

EXTENDED DESCRIPTION

94       None.
95

EXIT STATUS

97       The following exit values shall be returned:
98
99        0    Successful completion.
100
101       >0    A request for a higher limit was rejected or an error occurred.
102

CONSEQUENCES OF ERRORS

104       Default.
105
106       The following sections are informative.
107

APPLICATION USAGE

109       Since  ulimit  affects  the  current shell execution environment, it is
110       always provided as a shell regular built-in. If it is called in a sepa‐
111       rate utility execution environment, such as one of the following:
112
113
114           nohup ulimit -f 10000
115           env ulimit 10000
116
117       it does not affect the file size limit of the caller's environment.
118
119       Once  a  limit  has been decreased by a process, it cannot be increased
120       (unless appropriate privileges are involved), even back to the original
121       system limit.
122

EXAMPLES

124       Set the file size limit to 51200 bytes:
125
126
127           ulimit -f 100
128

RATIONALE

130       None.
131

FUTURE DIRECTIONS

133       None.
134

SEE ALSO

136       The  Base  Definitions  volume  of POSIX.1‐2017, Chapter 8, Environment
137       Variables, Section 12.2, Utility Syntax Guidelines
138
139       The System Interfaces volume of POSIX.1‐2017, ulimit()
140
142       Portions of this text are reprinted and reproduced in  electronic  form
143       from  IEEE Std 1003.1-2017, Standard for Information Technology -- Por‐
144       table Operating System Interface (POSIX), The Open Group Base  Specifi‐
145       cations  Issue  7, 2018 Edition, Copyright (C) 2018 by the Institute of
146       Electrical and Electronics Engineers, Inc and The Open Group.   In  the
147       event of any discrepancy between this version and the original IEEE and
148       The Open Group Standard, the original IEEE and The Open Group  Standard
149       is  the  referee document. The original Standard can be obtained online
150       at http://www.opengroup.org/unix/online.html .
151
152       Any typographical or formatting errors that appear  in  this  page  are
153       most likely to have been introduced during the conversion of the source
154       files to man page format. To report such errors,  see  https://www.ker
155       nel.org/doc/man-pages/reporting_bugs.html .
156
157
158
159IEEE/The Open Group                  2017                           ULIMIT(1P)
Impressum