Industry guru Dave Taylor offers tech support on technical and business topics, including iPhone, iPod, Microsoft Windows, Sony PSP, cellphones, online advertising, CSS, Web design, business, Unix, Linux, SEO, Mac OS X, and shell script programming.     


What capabilities does the Lynx text-only Web browser offer?

A reader writes in to me, asking whether I think that the Lynx web browser, a command-line screen-oriented alternative to the big, splashy graphical web browsers like Firefox, Mozilla, Safari and Internet Explorer, has any relevance in the modern world of technology and broadband. It's a fair question, and in fact I just published an article in SysAdmin Magazine on this subject.

Dave's Answer:

In case you don't get this magazine -- and you should if you're responsible for administering even a single Unix or Linux system -- I'm republishing the article here for your reading pleasure.


Take a deep breath and let's go back in time a few years, back to Windows 95. Think about people saying "Leenucks? What's that?" and just maybe imagine being in a public place without 10% of the people chatting away on cellphones. Remember an upstart company called Netscape and a browser formerly known as NCSA Mosaic. And let's go back just a little bit further...

When the World Wide Web first appeared on the scene, it was all about content, not about flashy graphics, animated applets and wireless browsing hotspots. The first Web browser, in fact, was a text-based browser that only worked in terminal windows.

As browser technology evolved, as "document object models" became the vogue, and as the Netscape browser was crushed by Microsoft, acquired by America Online, and then resurrected as an open source project that works across all the major computing platforms.

Meanwhile, a small group at the Distributed Computing Group of the University of Kansas were creating and growing a powerful text-only Web browser called Lynx. In fact, two of the original Lynx developers, Lou Montulli and Garrett Blythe joined Netscape in 1994. The Lynx program continues to grow and evolve to meet the ever-changing Web and HTML standards, now maintained by a consortium of Internet programmers.

If you've been living in the world of graphical Web browsers, you might just be surprised at how useful a text-only command-line based Web browser can be for your daily Internet interactions.

GETTING YOUR OWN COPY OF LYNX


First off, odds are good that you have Lynx on your computer already (try typing "which lynx" or "locate lynx" to find out) but if you aren't lucky or you find that you have a really old version (the current version is 2.8.5), pop over to http://lynx.isc.org/ and you'll find plenty of different download options. Lynx is also available for Mac OS X and various flavors of Windows, so even if you're not a hard-core Unix/Linux type, you can still reap most of the benefits of this terrific utility.

EIGHT GREAT REASONS TO LOVE LYNX

  1. Lynx is great for testing Web sites

    Modern Web browsers can sometimes be too sophisticated, and there are also plenty of different browsers to worry about too, from Firefox to Camino, Safari to Internet Explorer. Underneath them all, though, it's the content that you want to have come through properly, and Lynx is the Least Common Denominator of browsers. So it's safe to say: if it renders reasonably well in a text-only world, and the site is readable and functional, it should be at least somewhat okay everywhere else.

    Lynx is also good for reminding you what your site will look when you're on a cellphone connection, since the current generation of cellphone Web browsers render text only and barely understand line breaks, let alone anything more sophisticated. But previewing the page in a GUI-based browser makes it pretty difficult to know what's really going to happen.
  2. Lynx shields you from suspicious site tricks

    You're not too susceptible as a Linux user, but Web site owners nowadays have plenty of tricks up their sleeves to make your surfing experience less pleasant than it could be! From malicious spyware to viruses, to sneaky little JavaScript and ActiveX tricks that change your home page, resize your windows, pop up controlling windows that sporadically feed you additional adverts, and more, browsing the Web isn't as innocuous as it used to be. But Lynx shields you completely from this because it doesn't read the JavaScript code, doesn't accept or play ActiveX controls, shuns plug-ins and ignores everything that's not simple, straightforward HTML.
  3. Lynx is really, really fast

    If you're used to working with graphical browsers, I guarantee you'll be blown away by just how fast a text-only browser is. Once you skip all the graphics, you find that the 40-100 connections needed to properly render a Web page in Firefox are reduced to one connection -- for the HTML content only -- in Lynx, and your browsing speed increases commensurately.

    Many people who surf the web looking for specific information find that Lynx and its text-only brethren help them search for and find what they seek quite a bit faster. There's a reason that Google is almost completely text-based too: it's delightfully fast (particularly compared to overblown ad-heavy monstrosities like MSN and Yahoo).
  4. Lynx is disability-friendly

    If you're reading this article with a Versabraille or some other device that helps you overcome a visual disability, you already know another great facet of Lynx: it's disability friendly in a way that no GUI-based browser can be. By it's very nature, Lynx is designed for a keyboard-only interaction, with no pull-down menus, no pop-up windows, no mouse controls, and nothing to click on.

    HTML 4.0 introduced quite a few new HTML capabilities for disabilities, but with all the market pressure to add flashy new features, precious few GUI-based browsers have implemented everything in the HTML 4.0 standard, and, no surprise, disability features appear to be last on the list. That's why the built-in support of Lynx for disabilities is such a winner.
  5. Lynx lets you ensure you're XHTML complaint

    This may seem a bit trivial, but if you're building Web sites, you should be obsessively ensuring that every graphic you reference also includes an ALT tag. There are two reasons for this: first, it's good coding style and a requirement of the new XHTML standard, but more importantly, it's a simple way to ensure that your site is disability-friendly. And an added bonus too; if the sites you visit with Lynx have well-thought-out ALT tags then the browsing experience can be remarkably similar to a GUI-browser. Just a whole ton faster.
  6. Lynx frees you from worrying about connection speeds

    If you're not already paying a premium for high-speed broadband connectivity -- and even if you are -- there are fast connections and not so fast connections. And when you're on the road, even the best dialup is, well, a dialup connection. By using Lynx as your Web browser, you can ignore your connection speed, since the basic HTML page downloads in a flash even on the slowest connection!
  7. Lynx lets you browse the Web from servers

    I have a couple of different servers on which I host Web sites and other content, and sometimes it's just plain easier to use Lynx on the server, via an ssh or telnet connection. It's a great way to see what your server applications are seeing too, if you're scripting or otherwise automating any Web interactivity.
  8. Lynx is a fabulous tool for scripting Web interaction

    I realize that as the author of Wicked Cool Shell Scripts and a 25 year veteran of the Unix command line, I might be a bit more enthused about scripting and command lines than most people, but I have to say, Lynx is the secret ingredient behind dozens and dozens of my favorite tools and utilities.

    Need a command-line tool to convert currencies? Want to have the current weather in Fiji listed when you log in rather than some crufty old fortune? Want to monitor a dozen RSS feeds for your name or your company? All of these can be easily accomplished by scripting Lynx.

    Here's an easy example: Google assigns each page in its index a "page rank", a value between 0 and 10 that indicates the relative importance (to Google) of the page. It's good to know your page rank because the higher it is, the more relevant you'll be for search results and the better traffic you'll get from people searching Google. You can ascertain the page rank of any given URL with the Google Toolbar, but it turns out various Web sites have figured out how to get the page rank with a simple CGI script call.

    A perfect job for Lynx!

    Here's a tiny shell script that uses Lynx to feed in a URL and ascertain its page rank from the top25web.com form:
    #!/bin/sh
    
    echo -n "$1 page rank is"
    
    echo "url=$1" | 
        lynx -post_data "http://www.top25web.com/pagerank.php" | \
        grep "$1" | \
        cut -d: -f3-
    
    exit 0
    Easy enough! And with this called, say, "pagerank", you can easily ascertain the page rank of any page with:
    $ pagerank http://www.intuitive.com/
    http://www.intuitive.com/ page rank is 6/10
    Really, the only limitation to your scripting Lynx is your imagination. Anything you can find on the Web, anything you can get to come up in a browser, you can script with Lynx and some shell scripting tricks.

IN CONCLUSION

I'll come clean with you. I use Safari, Firefox and, on rare occasions, Internet Explorer when I'm surfing the Web. But when I'm scripting or testing sites, Lynx is a winner and a tremendous addition to your Linux toolkit. Don't leave home without it!

Dave Taylor is a long-time member of the Unix community, including having created the Elm Mail System and written a number of popular books on the subject including "Teach Yourself Unix in 24 Hours" and "Wicked Cool Shell Scripts". You can find him online at http://www.intuitive.com/

Related Unix and Linux Help articles:
✔   Copy and Paste from the Mac OS X Command Line?
I am constantly running commands in Terminal.app on my MacBook and then copying and pasting the results into email messages or documents. Yes,...
✔   Shell script to convert lowercase to title case?
As part of a project I'm working on, I find myself deep in a Linux shell script, needing to have a subroutine that...
✔   Can I script renaming files based on an XML data map?
I have a folder full of files which are named with four digits and a file extension e.g. 0312.file and an XML-file describing...
✔   Test for valid numbers in a Bash shell script?
In a different discussion on this site [see Redirecting input in a shell script] a visitor commented that "I was too busy trying...
✔   Review: iSSH for the iPad/iPhone
If you're running an online business like I am, there are times when you need to connect and log in to the server...

Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
    Enter your name: and your email addr:  









Reader Comments To Date: 5

Stewart Vardaman said, on November 23, 2004 3:43 AM:

I use lynx some for idle surfing at the office. The boss monitors web surfing, so sometimes I get my CNN fix by SSHing into a remote server I own, and lynxing from there. My boss can be nearly standing over my shoulder and not notice where I'm at because there's no logos/graphics. For news text or blogs, that's all I really need.

Side note: Fedora Core Linux leaves lynx out by default. :(

Dave Taylor said, on November 23, 2004 4:57 AM:

Ah, so now I'm aiding and abetting, eh? :-) That works, and, yes, you're right. Not only that, have a look at some of the scripts I wrote for Wicked Cool Shell Scripts at http://www.intuitive.com/wicked as you'll find that they can summarize news headlines without even using Lynx directly.

jot said, on May 30, 2006 2:29 PM:

I never used lynx.
But that doesn't mean that I don't understand the power that a command line browser has :)

Instead of lynx I use 'elinks'. Why ?
Because elinks features:
-tabbed browsing
-uri rewriting

Well those are main reasons, and as I think everybody understands tabbed browsing, I'll try to explain what uri rewriting is.

Uri rewriting speeds up browsing a lot, it's similiar to 'search engines' bar in firefox, but it uses address bar instead. So just bring address bar with 'g' , and type: 'g keyword' , this way you can look for 'keyword' in google. You can have multiple shortcuts like this.

Ok, and my other favorite feature of text browsers is '-dump' flag, it outputs web page as a plain txt, just like you see it on screen, it also gives you list of reference links, so if you want to download some pictures from a web site you can just write a little script for that.

Dave, you mentioned about getting the real pagerank with lynx, you sure know that this can be done with wget as well :)

So wget(or lynx)+sed+awk and you can get every content from the web you want. But what do I do with it you ask.
Just google 'torsmo' or 'conky' and use ${exec yourscript.sh} in its config file I answer.

Adam said, on August 21, 2007 6:19 AM:

Lynx is great because there's no more ads :P

George said, on July 25, 2009 3:55 PM:

Lynx is also useful if for some reason you are stuck at a command prompt and can't get to a GUI (ie: broken graphics drivers, configuration error, etc)

Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you, Dave, for all your helpful information by buying you a cup of coffee!

I do have a comment, now that you mention it!











I will never send you any unsolicited email. Ever.






Check This Out Too...

 
Look for Answers
Need Help? Ask Dave Taylor!
Powered By
Linux Journal: Free Issue!


Follow Me on Pinterest

Find Me on Google+
ADT on G+
© 2002 - 2013 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site. Further, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site. My lawyer says "Thanks".
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.