How to list automatically or "manually" installed packages

Aptitude (an APT front-end) has long been able to distinguish between packages as being automatically installed (based on some dependancy that another package required) or "manually" installed. Since Debian Lenny (5.0) this capability is integrated into the APT package management system and most probably Aptitude's functionality got a lot thinner (since it doesn't have to implement something that's already in APT's core).
I could not find a method to do this (ie. list the manual/auto installed status of packages) the APT-way, but Aptitude's search function does it well enough.
Here's the command to list automatically installed packages:
aptitude search '.*' | grep '^i.A' | less
And the trivial opposite (list of manually installed packages):
aptitude search '.*' | grep '^i.[^A]' | less

Syndicate content