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.
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
- 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.
- Lynx shields you from suspicious site tricks
- 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).
- 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.
- 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.
- 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!
- 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.
- 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.
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/