brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: ulimit -Sn only changes the open files limit of this linux shell

Linux
~/tips/tip-linux-ulimit-n-current-shell

ulimit -Sn

Raises the open files limit for one shell session, up to the hard limit.

People raise the limit in a terminal and wonder why their service still fails.

ulimit -Sn
ulimit -Hn
ulimit -Sn 4096

ulimit -Sn shows the soft limit on open files for the current shell and the programs it starts. In bash, ulimit -n 4096 without -S sets the soft and the hard limit, and an unprivileged user cannot raise the hard limit again afterwards, so use -S. You can raise the soft limit up to the hard limit shown by ulimit -Hn, and only for this shell and its children. A systemd service ignores it and needs LimitNOFILE= in its unit.

Further reading: Bash Reference Manual

More Linux tips a2query -m rewrite renice -n 10 -p 4242 cat config.yml | xsel -ib xvfb-run -a your-program --some-flag dpkg --get-selections > packages.txt All Linux tips (261) All topics

Link