Surfraw isn’t browsing the ‘net without a condom
March 28th, 2007 • bash, linux, web
About a month ago, my friend livinded introduced me to an infinitely helpful program for using in Bash or any other Linux shell: surfraw. Surfraw is an excellent tool to search for just about anything on the internet straight from the comfort of your shell. Installing it from source is as easy as unpackaging the source, running `./configure && make && make install`. Installing from Debian or Ubuntu is even easier as you can merely type `sudo aptitude install surfraw` and you’re done. Once it’s installed, all that’s left is to run `surfraw-update-path` and you’re ready to use it after you start another shell session.
I find this tool incredibly helpful because I use bash…a lot. I normally have two shells open that I’m currently working with and it’s so nice to be able to type `rfc 821` and have the original SMTP RFC pop up in Firefox on one of my multiple viewports (or virtual desktops for you non-Linux folks). This lets me work unhindered on what I was doing without having to stop, switch to the other desktop, pull up www.rfc-editor.org and search for 821, then go back to whatever I was doing in shell on the *other* desktop. This way, the RFC is ready for me when I need to reference it and it’s on another viewport so it’s non-distracting and unhindering to what I’m currently doing.
As you can see from the SourceForge site, surfraw has a ton of sensible options already built-in (google, yahoo, rfc, ask jeeves, etc. etc.) and adding new ones is very simple if you feel comfortable adding some shell code. I’ve written a few scripts like this in the past that were very much application-specific so I may end up adding those functions into surfraw’s elvi (the author’s oddball name for sites to search) for future use.
If you find yourself switching between a terminal window and your browser very often to look something up, I highly advise downloading surfraw to more streamline your tasks.