jarun / googler

:mag: Google from the terminal
GNU General Public License v3.0
6.11k stars 529 forks source link

Removing results #335

Closed DJGoossens closed 4 years ago

DJGoossens commented 4 years ago

Hi,

Thanks for googler. This is just a question, but I was not sure where to ask it. One of the things I use the most in Google is the - (hyphen) to remove results from the search. Now, I can do:

$ googler "search terms -term"

to eliminate sites with 'term' from the results.

But I would like certain some '-' terms to be always omitted -- eg I never want to find pages on etsy or pinterest. I cannot see how to do this using an alias. I don't want to have to give the flags every search. I can write a script that adds these to the googler search line. Is there any other way?

zmwangx commented 4 years ago
alias googler='googler " -site:pinterest.com -site:etsy.com"'
zmwangx commented 4 years ago

For clarity: all non-option arguments are concatenated to form the query. Adding a leading space makes sure -site:pinterest.com -site:etsy.com is treated as a non-argument without resorting to the -- delimiter, so that you can still use options afterwards.

DJGoossens commented 4 years ago

Wow, cool, thanks. The concatenation was not apparent to me from reading the man page. That's really great!