Pages

Saturday, March 5, 2011

Recently I have come in situation having low space. So I start thinking that how will I got the list of all RPM installed along with their size. So I have spend some time for searching and got the following nice command.

Let me explain the above thing
1.) rpm -qia will list all installed rpms along with their all Info.
2.) send above output to awk. It will see if first column is "Name", then set value of Third column to n(variable).Similarly, If first column is "Size", then set value of Third column to s(variable).
Note : If you just run rpn -qia then you will see that the row Having Name as first column have third column as its Actual Name and same with Size.

3.) Finally It Print Value of "s" and "n" variable and sort them in ascending order.