Skip to content

Instantly share code, notes, and snippets.

@rubencodes
Created September 15, 2016 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rubencodes/b021a01c605092a0701fddc6c88dae1f to your computer and use it in GitHub Desktop.
Save rubencodes/b021a01c605092a0701fddc6c88dae1f to your computer and use it in GitHub Desktop.
Google Search CLI
#Begin GoogleSearch CLI for Mac
function google() {
if [ $1 = "--images" ]; then
open https://google.com/search?tbm=isch\&q="$2"
elif [ $1 = "--news" ]; then
open https://google.com/search?tbm=nws\&q="$2"
else
open https://google.com/search?q="$1"
fi
}
#End GoogleSearchCLI for *nix
#Begin GoogleSearch CLI for Linux
function google() {
if [ $1 = "--images" ]; then
xdg-open https://google.com/search?tbm=isch\&q="$2"
elif [ $1 = "--news" ]; then
xdg-open https://google.com/search?tbm=nws\&q="$2"
else
xdg-open https://google.com/search?q="$1"
fi
}
#End GoogleSearchCLI for *nix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment