2011-11-17 聚會手記
Mat:
#!/bin/bash
lsof > lsof.log
cat lsof.log | awk '{print $1}' | sort | uniq > item.list
for item in `cat item.list`
do
echo -n "$item: "
cat lsof.log | grep '^$item ' | wc -l
done
Kanru:
lsof | | awk '{count[$i]++ } END { for (item in count) printf "%d: %s\n", count[item], item}'|sort -n