Counting open files per process Posted in : 電腦相關應用 2017-08-17 原來,在Linux 裡同一個process 不能開太多檔案,會掛掉。要知道process 開了多少檔案的指令: ls /proc/$pid/fd/ | wc -l Have a look at the /proc/ file system: ls /proc/$pid/fd/ | wc -l To do this for all processes, use this: cd /proc for pid in [0-9]* do echo "PID = $pid with $(ls /proc/$pid/fd/ | wc -l) file descriptors" done linux