Home

ulimit

Ultilimit? The term is actually “ulimit.” It is a shell builtin in many Unix-like systems that controls the resources available to the shell and to the processes started by it. The limits exposed by ulimit reflect the kernel’s resource limits, commonly implemented via getrlimit and setrlimit, and therefore affect only the current session and its children unless changed again in a broader context.

Soft and hard limits: Each resource limit has a soft value, which the kernel enforces for the

Common limits: Typical resources include CPU time (-t), file size (-f), data segment size (-d), stack size

Usage: The command ulimit -a shows all current limits. To set a limit, specify the option and

Scope and configuration: ulimit affects the current shell session and its children. For persistent system-wide limits,

running
process.
A
hard
limit
acts
as
an
upper
bound
that
typically
requires
elevated
privileges
to
increase.
Users
or
administrators
can
tighten
limits
to
prevent
runaway
processes
or
protect
system
stability.
(-s),
core
file
size
(-c),
number
of
open
files
(-n),
resident
set
size
(-m),
virtual
memory
(-v),
and
the
number
of
processes
(-u).
The
exact
options
can
vary
by
shell,
but
Bash,
for
example,
supports
a
wide
set
of
these.
value,
possibly
with
-S
for
soft
or
-H
for
hard.
Examples:
ulimit
-n
1024
sets
the
soft
limit
on
open
file
descriptors
to
1024;
ulimit
-S
-n
2048
raises
only
the
soft
limit
(if
permitted);
ulimit
-t
60
sets
CPU
time
to
60
seconds.
administrators
use
configuration
files
such
as
/etc/security/limits.conf
(on
Linux)
or
PAM
modules,
rather
than
per-shell
ulimit
changes.