lsofstat 184 B

1234567891011121314
  1. #!/bin/sh
  2. if [ "$1" = "-h" ]; then
  3. cat <<EOF>&2
  4. Usage: ${0##*/}
  5. Print number of open files per process.
  6. EOF
  7. exit
  8. fi
  9. lsof | awk '{x[$1]++} END {for(i in x) print i, x[i]}' | sort