LinuxCommandLibrary

lynx

View websites in a text-based browser

TLDR

Visit a website

$ lynx [example.com]
copy

Apply restrictions for anonymous account
$ lynx -anonymous [example.com]
copy

Turn on mouse support, if available
$ lynx -use_mouse [example.com]
copy

Force color mode on, if available
$ lynx -color [example.com]
copy

Open a link, using a specific file to read and write cookies
$ lynx -cookie_file=[path/to/file] [example.com]
copy

Navigate forwards and backwards through the links on a page
$ [<ArrowUp>|<ArrowDown>]
copy

Go back to the previously displayed page
$ [<ArrowLeft>|<u>]
copy

Exit
$ <q><y>
copy

SYNOPSIS

lynx [options] [URL]
lynx [options] [filename]

PARAMETERS

-dump
    Dumps the formatted output of a specified URL to standard output, without entering interactive mode. Useful for scripting and extracting content.

-crawl
    Enables the internal web crawler. Often used with -dump for automated content extraction and link discovery.

-anony
    Disables sending personal information, such as email address or referrer, to remote sites, enhancing privacy.

-cfg=file
    Specifies an alternative configuration file to use instead of the default lynx.cfg, allowing custom settings.

-display_charset=charset
    Sets the character set for display output, useful for proper rendering of international characters.

-vikeys
    Enables VI-like key bindings for navigation within the browser, familiar to VI/Vim users.

-emacskeys
    Enables Emacs-like key bindings for navigation within the browser, familiar to Emacs users.

-reload
    Forces a reload of cached pages from the remote server, ensuring the latest content is displayed.

-width=N
    Sets the desired display width for text formatting, overriding the terminal's default width.

-restrict
    Enables various restrictions on browsing, such as disallowing file access or saving content, for security or controlled environments.

-list_url
    Prints a list of all URLs found in the specified document to standard output, without entering interactive mode.

DESCRIPTION

lynx is a widely used text-based web browser that operates in a command-line environment. It allows users to browse websites, view documents, and navigate the internet without a graphical interface.

Renowned for its speed and low resource usage, lynx is particularly useful for low-bandwidth connections, scripting, accessibility (screen readers), and accessing information on servers without a GUI. It interprets HTML and displays text, links, and forms in a character-based format, making it an invaluable tool for developers, system administrators, and users who prefer terminal-based interactions.

CAVEATS

lynx does not support JavaScript, Flash, Java applets, or other complex multimedia content. Modern web pages relying heavily on these technologies may not render correctly or be navigable, leading to a loss of visual context and layout. Security updates for lynx have been less frequent compared to graphical browsers, potentially leaving older versions vulnerable to unpatched issues. It also lacks support for CSS, which means page aesthetics are entirely lost.

ACCESSIBILITY

lynx is highly valued for its accessibility features. Its text-only nature makes it ideal for use with screen readers and for users with visual impairments, providing a direct and uncluttered representation of web content without visual distractions.

SCRIPTING AND AUTOMATION

Due to its command-line interface and powerful options like -dump and -crawl, lynx is frequently used in shell scripts for tasks such as scraping data, checking website availability, converting web pages to plain text, or generating sitemaps for further processing.

HISTORY

Developed at the University of Kansas by Lou Montulli, Michael Grobe, and Charles Rezac, lynx was originally conceived in 1992 as a distributed information system client. It evolved into a full-fledged WWW browser in 1993, making it one of the oldest web browsers still in use today. Its early development predates graphical browsers like Mosaic, and it played a crucial role in making the internet accessible in a command-line environment, especially for educational and research institutions and for users with limited graphical capabilities.

SEE ALSO

w3m(1), elinks(1), links(1), curl(1), wget(1)

Copied to clipboard