When you’re performing some tasks in the terminal and want to search for some information on a specific site, you have to leave the terminal and run your browser to do the search. S proves there’s a better way to do it.
S is not the only tool to allow you to search the Web from the terminal, but it supports a dozen search engines out of the box. Also known as S-Search, when you carry out a search, the results will appear in your default browser and not directly in your terminal. Let’s see how to search for anything at Google, Amazon, DebianPKG, IMDB, and many others, with a simple command from your terminal.
The easiest way to install S-search is by using snap. To do it this way, fire up your favorite terminal and type:
sudo snap install s-search
If you prefer the visual way of doing things, you can install it through your distribution’s Software Center/App Store. You can locate the application there by using its name: “S-search.”
If S-search isn’t available in your distribution’s repositories, you can find instructions at its GitHub page to install it from source.
Searching from the Terminal
To search for anything from your terminal on Google Search, you only have to type its name, followed by your query.
For example, to search for our site, Make Tech Easier, we issued the command:
s-search make tech easier
Almost immediately after, our default browser – in our case, Firefox – popped up, showing the results of that search request. It was just as if we had manually visited the Google Search page and typed our query there ourselves.
Alternative Search Providers
S-Search proves ultra-useful because it supports many other search engines as well. To see a list of all of the sites where you can look for something with S-search, type:
To target your query at one of them, you can use their name/keyword like:
s-search -p amazon soldering iron
In the query above, we used S-search to seek a soldering iron at Amazon’s web store.
By swapping the provider and the query term, we could, for example, search for a particular song at Spotify. To search for an image at 500px, a game at Steam, and so on.
Behind the Scenes
S-search doesn’t use any advanced algorithms or complex code to pull this off. In fact, S-search is just a collection of search URLs, to which it adds our search queries.
You can check out each of them for any of your searches by using the
-o switch. With this switch, instead of opening your default browser to display the results of your query, S-search will reveal the search URL in your terminal.
Although the approach was precisely the same, S-search comes with dozens of such URLs for many popular sites baked in and is accessible from the terminal. This combination renders it quite useful since it allows you to search for anything on a whim.
Our latest tutorials delivered straight to your inbox