I guess i is installed, but the others?
$ apt search * | sort -t' ' -k1 | cut -c1 | uniq
c
i
p
v
I guess i is installed, but the others?
$ apt search * | sort -t' ' -k1 | cut -c1 | uniq
c
i
p
v
apt search’s output takes the form
package name/suites version architecture [state]
description
so extracting the first column won’t give much useful information.
Addressing your updated question from your comment, “how to know search and check for installed at the same time?”, you can use
apt search $pattern | grep -A1 '\[.*installed.*\]'
This will show the installed packages matching $pattern; for example on my system
$ apt search evdev | grep -A1 '\[.*installed.*\]'
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
evemu-tools/stable,now 2.7.0-1 amd64 [installed,automatic]
Linux Input Event Device Emulation Library - test tools
--
joystick/stable,now 1:1.6.1-1 amd64 [installed]
set of testing and calibration tools for joysticks
--
libevdev-build-deps/now 1.6.0+dfsg-1 all [installed,local]
build-dependencies for libevdev
--
etc.
The warning is irrelevant here; you can’t avoid it by using apt-cache instead because apt-cache doesn’t show all the information needed.
You can also use aptitude:
aptitude search '~i evdev`
will search for installed packages matching “evdev”.