Sep 032012
           ______  _     _  ______   _______  ______   _______  _  _  _
          / _____)(_)   (_)(_____ \ (_______)(_____ \ (_______)(_)(_)(_)
         ( (____   _     _  _____) ) _____    _____) ) _______  _  _  _
          \____ \ | |   | ||  __  / |  ___)  |  __  / |  ___  || || || |
          _____) )| |___| || |  \ \ | |      | |  \ \ | |   | || || || |
         (______/  \_____/ |_|   |_||_|      |_|   |_||_|   |_| \_____/
         Surfraw - Shell Users' Revolutionary Front Rage Against the Web

Surfraw stand for: Shell Users’ Revolutionary Front Rage Against the Web and is a funny way to query Search engines and other services on the net from the terminal; well, is funny for people who think that working on the CLI is funny ;), ah and have I told you that Surfraw was originally written by Julian Assange ? yes that one, so it must be a good tools to get information from the net…


On Debian and Ubuntu the package is available in the main repository so you can easily install it running in a terminal:

sudo apt-get install surfraw surfraw-extra

Please note that in this example I’ve installed also the package surfraw-extra that contains extra website search tools for surfraw that have large dependency trees (39 packages for me). Currently surfraw-extra only contains opensearch -that is used to search an OpenSearch-enabled website.

The package should be available also on Fedora and openSUSE, but at the moment I’ve no installations of these distributions so I’m not sure.

As alternative is possible to get the package directly from git with the following command:

git clone git://

Basic usage

Surfraw uses what it calls “elvi” (a tribute to Elvis); elvi are interface widgets for specific engines and databases such as Google, AltaVista, Wikipedia, Dejanews, Freshmeat, research index, Slashdot, ArXiv, Youtube, and a number of others. It allows options for configuration of using a shell browser (lynx, w3m) or a graphical browser (Firefox, Mozilla, Konqueror).

The basic syntax of Surfraw is:

surfraw elvi [options] searchterms

If possible Surfraw will create a new window in an existing browser session.
Otherwise it will follow its configuration, Surfraw gets it from three sources, in order:

1. Environment variables
2. /etc/xdg/surfraw/conf
3. $HOME/.config/surfraw/conf

In the configuration files it’s possible to use def and defyn to define variables. These functions set variables unless they are already set by the environment. defyn is used for boolean configuration variables, def for all others. For instance:

        def     SURFRAW_text_browser /usr/bin/lynx
        defyn   SURFRAW_graphical         no

You can see the list of the variables in the manual page of surfraw with the command

man surfraw

Examples with Surfraw

To see the list of elvi type:

        surfraw -elvi

Note that sr is an alias for surfraw, so that could equally be

        sr -elvi

Search in wikipedia the word gentoo

sr wikipedia gentoo

Show the first 100 results of a search on google of the phrase “RMS, GNU, which is sinner, which is sin?” and display the result with links:

surfraw google -results=100 RMS, GNU, which is sinner, which is sin? -browser=links

List of Elvi

This is the list of Elvi, web site search scripts, contained in Surfraw

acronym — Look for acronyms definitions (
ads — Search SAO/NASA Astrophysics Data System
alioth — Search Alioth (
amazon — Search the bookstore
archpkg — Search Arch Linux Packages (
archwiki — Search the Arch Linux Wiki
arxiv — Search arXiv E-Print Archive for articles
ask — Question the web using Ask Jeeves (
aur — Search for PKGBUILDs
austlii — Search Australian Law docs (
bbcnews — Search BBC News (
bing — Search the web using Microsoft’s Bing (
bookfinder — Search for books using
bugmenot — Bypass compulsory web registration with
bugzilla — Search for bugs on Bugzilla bugtrackers
cablesearch — search openports for OpenBSD packages
cia — Search CIA documents at
cite — Search computer science papers (
cliki — Search the common lisp wiki
cnn — Search on CNN (
codesearch — Search source code using Google Code Search (
comlaw — Search Australian Law using Comlaw (
ctan — Search the Comprehensive TeX Archive Network (
currency — Convert currencies with the Universal Currency Converter (
cve — Search for CAN assignments in CVE
debbugs — Search the debian BTS (
debcontents — Search contents of debian/ubuntu packages (
deblists — Search debian mailing lists (
deblogs — Show changelogs for a package in Debian main (
debpackages — Search debian/ubuntu packages (
debpkghome — Visit the home page for a Debian package
debpts — Search the Debian Package Tracking System (
debsec — Search the Debian Security Tracker for CVE ids or package names
debvcsbrowse — Browse the VCS repository for a Debian package
debwiki — Search the Debian Wikis ( &
deja — Search usenet using Google Groups (
deli — Search Delicious bookmarks
discogs — Search the Discogs database of music information (
dmoz — Search the Open Directory Project web directory (
duckduckgo — Securely search the web using duckduckgo (
ebay — Search the Ebay auction site
etym — Look up word origins at
excite — Search on Excite (
finkpkg — Search Fink packages (
foldoc — The Free On-Line Dictionary Of Computing (
freebsd — Search FreeBSD related information (
freedb — Search for cd track listings in FreeDB (
freshmeat — Search Freshmeat (
fsfdir — Search the FSF/UNESCO Free Software Directory (
gcache — Search the web using Google cache (
genbugs — Search the Gentoo bug tracker (
genportage — Search for packages
google — Search the web using Google (
gutenberg — Search for books on Project Gutenberg (
happypenguin — Search the Linux Game Tome (
imdb — Search the Internet Movie Database (
ixquick — Search the web using ixquick [HTTPS] (
jamendo — Search Jamendo: free music with Creative Commons licenses (
javasun — Search Java API docs (
l1sp — Search lisp documentation
lastfm — Search
leodict — Search Leo’s German English dictionary (
lsm — Search the Linux Software Map
macports — Search macports packages (
mathworld — Search Wolfram MathWorld
mininova — Search the mininova bittorent source.
musicbrainz — Search MusicBrainz (
netbsd — Search NetBSD related information (
ntrs — Search the NASA Technical Report Server
openbsd — Search OpenBSD related information (
openports — search openports for OpenBSD packages
opensearch — Search an OpenSearch-enabled website
pasearch — Search the unofficial Penny Arcade archives (
pgpkeys — Search the PGP key database
piratebay — Search for torrents
pubmed — Search medical/molbio databases (
rae — Busca en el diccionario de la Real Academia de la Lengua Española (Spanish Dictionary)
rfc — Search RFCs (internet standards documents)
rhyme — Search for rhymes et al using Lycos Rhyme (
rpmsearch — Search for RPMs in various distros
scholar — Search Google Scholar (
scicom — Search Scientific Commons
scirus — Search for science using Scirus (
scitopia — Search for science with
scpan — Search the Comprehensive Perl Archive Network (
scroogle — Search Google anonymously via Scroogle (
slashdot — Search stories on Slashdot (
slinuxdoc — Search entries in LDP (
sourceforge — Search SourceForge (
springer — Search Springer for Books and Articles
stack — Search Stack Overflow
stockquote — Get a single stock quote (multiple providers)
sunonesearch — Search Sun One Search (
thesaurus — Look up word in Merriam-Webster’s Thesaurus (
translate — Translate human languages (various providers)
urban — Search for a definition
W — Activate Surfraw defined web-browser
w3css — Validate a CSS URL with the w3c CSS validator (
w3html — Validate a web page URL with the w3c validator (
w3link — Check web page links with the w3c linkchecker (
w3rdf — Validate a RDF URL with the w3c RDF validator (
wayback — Search The Internet Archive’s Wayback Machine for a URL (
webster — Look up word in Merriam-Webster’s Dictionary (
wetandwild — Real time weather information (many sources)
wikipedia — Search the free encyclopedia wikipedia
woffle — Search the web using Woffle (localhost:8080)
worldwidescience — Search for science with
yahoo — Search Yahoo categories (
yandex — Search the web using Yandex (
youtube — Search YouTube (
yubnub — Use the social command-line for the web (

Popular Posts:

Flattr this!

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>