I love Linux! There’s no two ways about it! For the past few years, I’ve become enamored with the open-source jewel that is Linux.
Lately, I’ve been going crazy with aliases. I’ve also been trying to make my life easier with some simple Bash/Python scripts.
When my friends over at Hak5 uploaded a HakTip about searching Wikipedia from the terminal, I knew I had to alias/script it up!
Here’s the script I put together:
1
2
3
4
5
6
7
/bin/bash
# Store all arguments I provide as a string, SEARCH
SEARCH="$*"
# Replace any spaces with underscores, search wikipedia
dig +short txt ${SEARCH// /_}.wp.dg.cx
Combine that with an alias, like alias wp='/home/elliot/bin/digwp.sh'
,
and we get the following:
I LOVE SHORTCUTS!!
Photo by J Aaron Farr