0

I want to search several words in FreeBSD packages using pkg command

Example, if I want to search all packages with the words "web server" in the description, someone would try this:

pkg search web server

But it does not work. Neither with quotes.

somenxavier
  • 121
  • 5

1 Answers1

0

Suspecting you want to search for both words you use grep:

pkg search web |grep server

Based on pkg documentation this command should work:

pkg -g search "web server"

You may add -i to make search case insensitive

Romeo Ninov
  • 5,319
  • 5
  • 20
  • 20
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - [From Review](/review/low-quality-posts/1190230) – Joep van Steen May 20 '23 at 19:08
  • @JoepvanSteen, this provide the answer of the question: "How to search several words in pkg". The OP do not mention he/she want to do the entire search **only** in `pkg`. So it is an answer, sample, fast and short! Also it is not required to write "War and Peace" to answer clearly to the question and to provide valuable answer. – Romeo Ninov May 20 '23 at 19:13
  • It's a question. I flagged it as low quality answer, feel free to edit and improve it. – Joep van Steen May 20 '23 at 19:16
  • @JoepvanSteen, and it provide answer: the example command give to OP the operation he/she search. – Romeo Ninov May 20 '23 at 19:17
  • This cicumvents the question using sh commands. But I need to know if there is such capability in `pkg` itself. – somenxavier May 21 '23 at 11:11
  • @somenxavier, I update my answer – Romeo Ninov May 21 '23 at 14:58
  • 1
    @somenxavier if you want a solution using just `pkg`, that should be clearly stated in the question. – Destroy666 May 22 '23 at 08:10
  • @Destroy666 Edited question – somenxavier May 22 '23 at 15:05