M8ram
11-15-2001, 12:20 PM
At [URL=http://www.redhat.com/docs/books/max-rpm/max-rpm-html/s1-rpm-query-handy-queries.html]http://www.redhat.com/docs/books/max-rpm/max-rpm-html/s1-rpm-query-handy-queries.html[/UR L] if found some interesting queries for rpm
Unfortunatly I am not familiar with the entire syntax of those queries, I am looking for a querie that will display all installed packages alphabetically (did I write that correctly?).
too get a list sorted by install-date you need
# rpm -qa --queryformat '%{installtime} %{name}-%{version}-%{release} %{installtime:date}\n' | sort -nr +1 | sed -e 's/^[^ ]* //'
too get a list sorted by size you need
# rpm -qa --queryformat '%{name-%{version}-%{release} %{size}\n' | sort -nr +1
so I know I need
# rpm -qa --queryformat '%{installtime} %{name}-%{version}-%{release} %{installtime:date}\n'
but how do I have to write the sort command so it sorts by package name?
It's probably really silly once you know the syntax for this kind of code, but well... I'm a newbie, I don't...
Thanks in advance!
OK I'll admit it myself: this probably was the dumbest post ever!
I'm having problems sleeping lately if that can count as an axcuse....
I now realise that all I had to do was add "| sort" at the end of the command...
The command is now longer than fits my screen but everything works as it should...
Sorry for bothering you guys with this!
:( :o
[ 03 December 2001: Message edited by: M8ram ]
Unfortunatly I am not familiar with the entire syntax of those queries, I am looking for a querie that will display all installed packages alphabetically (did I write that correctly?).
too get a list sorted by install-date you need
# rpm -qa --queryformat '%{installtime} %{name}-%{version}-%{release} %{installtime:date}\n' | sort -nr +1 | sed -e 's/^[^ ]* //'
too get a list sorted by size you need
# rpm -qa --queryformat '%{name-%{version}-%{release} %{size}\n' | sort -nr +1
so I know I need
# rpm -qa --queryformat '%{installtime} %{name}-%{version}-%{release} %{installtime:date}\n'
but how do I have to write the sort command so it sorts by package name?
It's probably really silly once you know the syntax for this kind of code, but well... I'm a newbie, I don't...
Thanks in advance!
OK I'll admit it myself: this probably was the dumbest post ever!
I'm having problems sleeping lately if that can count as an axcuse....
I now realise that all I had to do was add "| sort" at the end of the command...
The command is now longer than fits my screen but everything works as it should...
Sorry for bothering you guys with this!
:( :o
[ 03 December 2001: Message edited by: M8ram ]