The largest 30 packages on your system

Found this while surfing:
Code:
#!/bin/sh

# top30ports.sh
# it shows a listing of the 30 largest ports 

top=30
newline='\
'

echo "The largest $top packages on your system"
echo "--------------------------------------"
echo "Size (kB)   Package"
echo "--------------------------------------"

pkg_info -as | \
         tr '\n' ' ' | \
         sed -e 's/Package Size://g' \
                 -e "s/(1K-blocks)/$newline/g" | \
         tr ':' ' ' | \
         awk '{print$4,"     ",$3}' | \
         sort -gr | \
         head -"$top"

Taken from: http://tutorials.papamike.ca/pub/fbsd-ports2.html
 
Or just
Code:
pkg_info -as | tr '\n' ' ' | sed -e 's/Package Size://g' -e 's/(1K-blocks)/\\
/g' | awk '{print $4 " "$3}' | sort -gr
;)
 
Back
Top