Can 'apt search' display results as one-liners like 'apt-cache search' does?

2

1

I just recently discovered the shorthand versions of apt commands: apt install instead of apt-get install, apt update / apt-get update, apt search / apt-cache search. Is there a config setting to make apt search display results as one-liners, like apt-cache search does ? It's less output and usually I don't need the description to decide which package to install.

patraulea

Posted 2016-04-04T09:36:30.137

Reputation: 171

My apt search does show one-line results, similar to apt-cache search, but apt only shows a few results for a "bash" search, while apt-cache has dozens... What version of apt do you have? Surprisingly apt doesn't know the --version flag, while apt-cache --version says apt 1.0.1ubuntu2 .... It seems plain apt is still under active development...? – Xen2050 – 2016-04-04T13:51:20.810

Both searches for bash return 94 results here (ubuntu 14.04). And yes, it says "apt does not have a stable CLI interface yet" at the end. – patraulea – 2016-04-04T15:10:16.770

in ubuntu 18.04, apt search still shows result in two lines with a empty line in between each result which is even worse. And when there is a long list of result, the most relevant one is normally on the top, but it's already disappeared, since you can only see the last few results on the screen. This makes the 'apt search' useless. It forces me to always add a grep pipe like apt search python | grep '^python' | less . Looking for a clean one-liner solution. – nngeek – 2019-08-06T09:26:02.260

Answers

0

You can set alias aptsearch for apt-cache search command in .bashrc file in your home folder. All current command aliaces can bee seen with alias command.

Oleg Bolden

Posted 2016-04-04T09:36:30.137

Reputation: 1 507