DEV Community

Cover image for How to search Google from the terminal
Richard MacCaw
Richard MacCaw

Posted on

How to search Google from the terminal

I'm sure we all do a lot of Googling in our day to day coding. Hopefully this alias will save you some time and improve your productivity. Feel free to share your most used aliases below!

Add to $HOME/.bashrc or $HOME/.zshrc depending on which shell you use.

function google {
  open -a 'Google Chrome' https://www.google.com/search\?q\="$1"
}

Restart your terminal. 💵👏

Some examples:

google "center div flexbox"
google "padding vs margin"
google "how to css"
google dev.to

Top comments (0)