Front | Info | Lists | Newsfeeds | Study Guide | What is BSD?
Advertisement: The OpenBSD PF Packet Filter Book: PF for NetBSD, FreeBSD, DragonFly and OpenBSD

BSD Links
·New Links
·User Groups

This is the BSDA Study Guide Book written via a wiki collaboration. This is a work in progress. You may contribute to or discuss this specific page at

Recognize the difference between hard and soft limits and modify existing resource limits


Understand that resource limits are inherited by the shell as well as how to view their limits and change them both temporarily and permanently. In addition, understand the difference between soft and hard limits.


limit: (in the csh(1) man page) limits the consumption by the current process and each process it creates to not individually exceed "maximum-use" and the specified "resource". (TODO: don't use man page verbatim)

limits: set or display process resource limits, either prints or sets kernel resource limits and may optionally set environment variables like env(1) and run a program with the selected resources. (TODO: don't use man page verbatim)

login.conf: login class capability database (/etc/login.conf, ~/.login_conf)

sysctl: get or set kernel state

View limits:

less /etc/login.conf or ~/.login_conf to see per user limits)

With limit (builtin): limit [-h] [resource [maximum-use]]

Resources include: cputime, filesize, datasize, stacksize, coredumpsize, memoryuse, heapsize, descriptors (or openfiles), concurrency (TODO ???), memorylocked, maxproc, sbsize

Maximum-use: default descriptor size is "k" or kilobytes (except cputime)

Change limits:


Permanently: 1) set them in login.conf 2) set them with limits 3) set them with builtin limit 4) set them with sysctl

Understand the difference between hard and soft limits: Hard limits set a ceiling on the value of the soft limits. Only the super user may raise the hard limits, but a user may raise or lower the current limits with the legal range.


Practice Exercises

More information

limit(1), limits(1), login.conf(5); sysctl(8) on NetBSD

Front | Information | Lists | Newsfeeds