LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

getrlimit

resource limit query and management interface

TLDR

Get resource limits (shell)
$ ulimit -a
copy
Get specific limit (open files)
$ ulimit -n
copy
Show resource limits of a process
$ prlimit --pid [pid]
copy
Set open file limit for a command
$ prlimit --nofile=4096 [command]
copy

SYNOPSIS

#include <sys/resource.h>int getrlimit(int resource, struct rlimit \*rlim);int setrlimit(int resource, const struct rlimit \*rlim);

DESCRIPTION

getrlimit() and setrlimit() are system calls for querying and setting resource limits for the calling process. These limits control maximum values for various system resources.The ulimit shell built-in provides command-line access to these limits. Limits have soft (current) and hard (maximum) values.

PARAMETERS

resource

Resource type (RLIMITNOFILE, RLIMITNPROC, etc.).
rlim
Pointer to rlimit structure with soft/hard limits.

CONFIGURATION

/etc/security/limits.conf

PAM configuration for setting default resource limits per user or group.
/etc/systemd/system.conf
Systemd-wide default resource limits for services and user sessions.

SHELL ACCESS

$ ulimit -n        # Open files
ulimit -u        # Max processes
ulimit -s        # Stack size
ulimit -a        # All limits
ulimit -n 4096   # Set open files limit
copy

CAVEATS

System call, not a command. Non-root users cannot raise hard limits. Some limits affect child processes. PAM may set limits at login.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid