Monday, May 18, 2009

How to list Open Files?

Perl One liner
lsof | perl -lane '$x{"$F[0]:$F[1]"}++; END { print "$x{$_}\t$_" for sort {$x{$a}<=>$x{$b}} keys %x}'

Bash Command

lsof | awk '{print $2}' | sort -n | uniq -c | sort -n|tail -n 20


No comments: