Skip to content

Instantly share code, notes, and snippets.

@cherryramatisdev
Created June 26, 2024 01:28
Show Gist options
  • Save cherryramatisdev/558e4a3f8361078083ebe333f95360aa to your computer and use it in GitHub Desktop.
Save cherryramatisdev/558e4a3f8361078083ebe333f95360aa to your computer and use it in GitHub Desktop.
How to search the web from the terminal (EN)
  1. Make sure you installed the w3m CLI
  2. Create a script like websearch with the following content:
#!/bin/sh

query=""
for arg in "$@"; do
    query="$query+$arg"
done
query=${query:1}  # remove leading +

url="https://lite.duckduckgo.com/lite/?kd=-1&kp=-1&q=$query"

w3m "$url"
  1. (Optional) Create an alias for easier management and place in your ~/.zshrc or ~/.bashrc:
alias '?'=websearch
  1. Be happy using it!
? how to use github
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment