Borg Lets You Search for Bash Commands within the Terminal

There are so many commands available in bash that it’s impossible to know them all, and some commands are rarely run. Usually, you have to switch to your web browser to search for a solution or spending time reading through the manpage. In case you’d like to search for a specific command line you can now do so with borg script.

borg-search

If you want to give it a try, you can install it in Linux as follows:


Then run the script with your search query in quotes.

Some explanations for the output:

  • () denotes hits for your query
  • [] denotes possible solutions
  • … under a [] means more lines to display
  • a “–” in a solution means separate code examples extracted from the same source

Some queries are returning useful results such as “list all files in dir” as show in the screenshot above, but others not so, as least for now:


This may improve in the future, as “adding a way to add entries and rate solutions” is part of the plan. The script queries a server running @ borg.crufter.com to look for solutions, but if you want your own it can also be self-hosted.

Via N0where

Support CNX Software - Donate via PayPal or become a Patron on Patreon

4
Leave a Reply

avatar
4 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
3 Comment authors
cruftercnxsoftJan de Boer Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jan de Boer
Guest
Jan de Boer

There is also “how2” which does the same, except for any topic easily answerable via google/stackexchange:

https://www.npmjs.com/package/how2

crufter
Guest

Hey guys!

Borg author here. Thanks for the feedback! You are right about the search result relevancy/usefulness. I did not explain this anywhere but one of the design goal was (big words for a program that was made in a couple of days of hacking) to be able to glance over a lot of potential solutions effectively – so I just grabbed the codes out of context – not so useful in every case – works perfectly in others.

I plan to tweak the search engine to give more relevant results, import more and cleaner data and give the ability to the user to rate the results and save and query their own snippets. The codebase is reasonably small, so it’s easy to get into.

Thanks for the support!