DEV Community

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

Posted on

2 1

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)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay