List certain installed packages

I am trying to see whether I have installed certain packages. I figured this would work

apt-get list --installed | grep "xxx"

but it doesn't. Any ideas?


Solution 1:

Try this:

apt list --installed | grep "xxx"

Edit: Alternatively, as Chev_603 wrote, you can do this:

dpkg -l | grep "xxx"

Edit 2: about apt list, see man apt. Looking at man apt-get shows that apt-get does not have the list --installed option.