Concerning your task, aptitude comes in handy aptitude -F '%p' search '!~aremove~i' -- Best regards, Jörg-Volker.