A quick and easy way get a readable version of a webpage directly from your terminal is to use the dump argument of the lynx text based web browser.

This is great for times when you are working from your terminal and want to view a website, for example to view a link received via IM, but would prefer not to leave your terminal to do so.

While tools like curl and wget will return the HTML file, including the HTML tags, lynx will parse it and return a much more readable version.

The following will output a readable version of this webpage directly to your terminal via stdout.
lynx -dump https://ryanmcconville.com/blog/

lynx

Sometimes you may want to save a readable copy of a webpage to a text file to read later. This can be done by redirecting stdout to a file.
lynx -dump https://ryanmcconville.com/blog/ > blog.txt

Lynx can also be used interactively for browsing the web by dropping the dump argument. For a program that predates the world wide web, it works suprisingly well on many modern websites.

This was posted on Thu 30 Oct 2014 (4 years, 7 months ago) by Ryan McConville
Comments