ulimit

Linux · System · reference only

What it does

Shows and sets the resource limits of the current shell and the processes it launches, such as open files or processes.

Syntax

ulimit [opciones] [límite]

Options and parameters

  • -a

    Shows all current limits.

  • -n

    Maximum number of open files.

  • -u

    Maximum number of processes for the user.

  • -c

    Maximum size of core dumps.

  • -s

    Maximum stack size.

  • -t

    Maximum CPU time, in seconds.

  • -H

    Acts on the hard limit, which cannot be exceeded.

  • -S

    Acts on the soft limit, the one applied by default.

Usage examples

  • ulimit -a

    Shows all the shell's limits.

  • ulimit -n

    Shows how many files a process can open.

  • ulimit -n 4096

    Raises the open file limit for this session.

  • ulimit -Hn

    Shows the hard limit of open files.

Notes and common mistakes

  • It only affects the current shell and its child processes.
  • For permanent limits, configure /etc/security/limits.conf.

Related commands