Last active
November 18, 2025 20:48
-
-
Save henri/bf8cbcb1fc08c64742d4ba0b4de75ae5 to your computer and use it in GitHub Desktop.
open file linux cheat sheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # show the limits in place on the system | |
| ulimit -a | |
| # system wide ulmits | |
| ulimit -Sn # soft limit | |
| ulimit -Hn # hard limit | |
| # list open files for all processes and sort them by how many files are open | |
| for pid in /proc/[0-9]*; do echo "PID = $(basename $pid) : $(ls $pid/fd 2>/dev/null | wc -l) open files"; done | sort -n -k5,5 | |
| # list all open files (provided not to many | |
| lsof | wc -l | |
| # list open files outout blocking - may not provide accurate counts | |
| lsof -b 2>&1 | wc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment