This is a repost from the Software Mastery newsletter. If you like what you see, consider subscribing to get emails delivered right to your inbox!
Welcome to the first issue of the Software Mastery newsletter.
In this issue, I want to share two tips about how to search effectively on Google.
Googling is a fundamental skill for software engineers, so much so that it’s a meme:
Engineers use Google for various reasons:
They forgot how to do something in a particular programming language.
They want to understand an error they’re seeing.
They need to learn about some engineering concepts.
Googling is a way to find resources, but ultimately, whether we’re able to find what we’re looking for depends on our search query.
Sometimes, the resource we’re looking for is out there, but Google isn’t ranking it highly enough in the search results for us to see it.
To refine a search query, here are two tips to get started:
Use the site:
operator to restrict results to a particular site.
Use the after:
operator to filter outdated results.
The site:
Operator
For certain search queries, we’re only interested in results from specific websites. To force Google to only show us results from a particular website, we can add site:
to a search query, followed by the website.
If you, for example, are particularly interested in what the people of Hacker News have to say about working at Google, you could write a search query like:
working at Google site:news.ycombinator.com
Here’s a more practical example. Suppose you’re developing on an EC2 instance and just ran docker build -t my-project .
to create a Docker image for your application. After a few minutes, the command fails with the following error message:
> docker build -t my-project .
Unable to find image 'python:latest' locally
latest: Pulling from library/python
5040bd298390: Pull complete
fce5728aad85: Pull complete
76610ec20bf5: Pull complete
52f3db4b5710: Extracting [==================================================>] 129.8 MB/129.8 MB
45b2a7e03e44: Download complete
75ef15b2048b: Download complete
e41da2f0bac3: Download complete
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: failed to register layer: Error processing tar file(exit status
1): write /usr/share/doc/libfreetype6/reference/ft2-type1_tables.html: no space left on device.
To filter Google’s search results for Stack Overflow posts, you could write the following search query:
docker no space left on device site:stackoverflow.com
This type of query can be useful sometimes if websites other than Stack Overflow are ranking highly for this particular search query but do not contain what you’re looking for.
The after:
Operator
Software engineering moves fast. As new versions of programming languages, frameworks, and libraries get released, tutorials and other resources get outdated quickly.
To retain search results after a certain year, we can add the after:
operator to a search query, followed by a year
, year-month
, or year-month-day
.
For example, if you’d only like to see Spring Boot tutorials written in 2024, you can write a search query like:
spring boot tutorial after:2023
Here’s another example that combines the after:
operator with the site:
operator.
Suppose I’m interested in what OpenAI has been up to in the past month, and I’m particularly interested in discussions about OpenAI on Reddit. I can find recent OpenAI-related Reddit posts with:
openai after:2024-07 site:reddit.com
Your Turn!
I hope this week’s issue gave you some ideas on how you can use Google’s search operators to find what you need on the Internet.
Do you have any tricks for refining your search queries? Reply to this email or comment below!
Thanks for reading! Until next time,
Sammy
Top comments (10)
Putting something in quotes makes Google search for an exact match. For instance, you might search for
"python3" type error
ifpython3 type error
returns a lot of results from older versions of Python. This isn't a good example though. I can't think of any better ones at the moment, but there are a lot of great use cases for this.Wonderful to see googling skills still being taught. Its almost like a science, really :P
Thanks, Martin!
this should be taught in every school. would make the online learning process more easy!
Agreed!
Interesting!
Thanks, John!
Cool!
Very Impressive!
Thanks, Raghav!