Vinícius Krolow

Let's hurt the code!

Sun, Mar 6, 2016

list processes with most opened files


lsof -n 2>/dev/null | awk '{print $1,$2}' | sort | uniq -c | sort -nr | head -25 | while read nr name pid ; do printf "%10d / %-10d %-15s (PID %5s)\n" $nr $(cat /proc/$pid/limits | grep 'open files' | awk '{print $5}') $name $pid; done
Hey, have you find a typo or english smell? help me improve my english, i'll be glad to receive an improvement here.