How to Google from the Mac Terminal

Feature thumb snip20170828 35

There are many times where I don't like switching from the terminal to the browser to perform a search. Such as trying to find a reference to a website or a word's definition and having to switch to the browser to search on Google. Lately I've been using the Googler tool in the terminal and it's provided a nice workflow for running searches inside of the terminal.

Obviously this doesn't allow you to view the full contents of the website, so this is more for quick lookups. However I have found it to be a fun addition to my workflow, especially with Tmux since it allows me to search Google, quickly copy the link to the clipboard and then I can use it however I need to.

To install using homebrew, run the command:

brew install googler

Assuming that the installation process works, you can now run commands such as:

googler devcamp

That type of general query is the same as running a search from and will output the top results, as shown below:

That's all well and good, but you would still need to copy the link and switch to the browser. And even more powerful way of using the tool would be to run a command such as:

googler -w routing

Now we're cooking with fire. This is actually helpful because it allows for you to search on specific websites for content and will output the following:

The tool is quite powerful and because it's a terminal program you can perform tasks such as piping the content to files and other handy tasks such as that. If this is something that you would find helpful, I highly recommend for you to go through the Github page, which has a comprehensive set of examples on how else you can use the tool: