Skip to content

Instantly share code, notes, and snippets.

@techgaun
Created October 29, 2014 15:01
Show Gist options
  • Save techgaun/b7e1457e6a705a8164ec to your computer and use it in GitHub Desktop.
Save techgaun/b7e1457e6a705a8164ec to your computer and use it in GitHub Desktop.
get open file of processes
#!/bin/bash
for x in `ps -ef| awk '{ print $2 }'`;
do
echo "pid:${x} process_name:$(cat /proc/$x/cmdline) count:$(ls -1U /proc/$x/fd | wc -l)" | column -t;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment