Here's a short script prints out the size of each rpm that you have
installed (as from 'rpm -qa'). Its output is useful for piping through
'sort -rn' so you can see what packages are taking up the most space, maybe
with an eye to removing some of them.
------------
#! /bin/sh
rpms=`rpm -qa`
for rpm in $rpms
do
size=`rpm -qi $rpm |grep "^Size" |sed -e 's/[^0-9]*\([0-9]*\).*/\1/'`
printf "%-20s%s\n" $size $rpm
done
------------
A quick question on the script, specifically about the line: rpms=`rpm -qa`
What's the limit of characters you can store in a variable?
Would I have had more space if I had done:
for rpm in `rpm -qa`
or are they effectively the same thing?
Padraig
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!