elinks Command in Linux: Syntax, Options & Practical Examples

Deepak Prasad
Tested on Ubuntu 25.04 (Plucky Puffin)
Package ELinks 0.16.1.1
Applies to Ubuntu, Debian, RHEL, Fedora
Privilege sudo or root
Man page elinks(1)
Scope ELinks is a terminal web browser for Linux. It renders pages in text mode for interactive browsing over SSH, and with -dump or -source it prints readable text or raw HTML for scripts and offline docs.
Related guides Linux commands

Short on time?Beta Get the gist of this 9-minute read in seconds, then ask follow-up questions

Batch output (scripts and pipes)

Print formatted text or raw HTML without opening the interactive browser — the most common automation use.

When to use Command
Print a readable text version of a URL elinks -dump https://example.com
Print raw HTML source to stdout elinks -source https://example.com
Save dumped text to a file elinks -dump https://example.com > page.txt
Save HTML source to a file elinks -source https://example.com > page.html
Set line width for -dump output elinks -dump-width 80 -dump https://example.com
Omit link numbers in dump output (cleaner for grep) elinks -no-numbering -dump https://example.com
Omit the References footer in dump output elinks -no-references -dump https://example.com

Interactive browsing

Open the full-screen text UI — useful on servers and over SSH when no graphical browser is available.

When to use Command
Browse a URL interactively (quit with q) elinks https://example.com
Start elinks and enter a URL at the prompt elinks
Restrict local file access and disk writes elinks -anonymous https://example.com

Local and offline files

Render HTML files and directories without network access.

When to use Command
Open a local HTML file in the browser elinks /path/to/page.html
Dump a local HTML file as plain text elinks -dump /path/to/page.html
Treat unknown document types as HTML elinks -force-html -dump file.dat

Lookup and connectivity

Quick checks from the same binary you use for browsing.

When to use Command
Resolve a hostname to IP addresses elinks -lookup example.com

Configuration

Inspect or customize ELinks settings.

When to use Command
Print the default configuration to stdout elinks -config-dump
Show help for configuration directives elinks -config-help
Use a custom configuration directory elinks -config-dir ~/.elinks-custom

Help and version

When to use Command
Show brief usage elinks -help
Show detailed usage elinks -long-help
Show version and build features elinks -version

Synopsis from elinks -help on Ubuntu 25.04 (ELinks 0.16.1.1):

text
elinks [OPTION]... [URL]...

With no URL and no -dump/-source, ELinks starts in interactive mode. For scripting, -dump and -source fetch each URL and exit — no key bindings required. Install with apt (sudo apt install elinks) on Ubuntu if the command is missing.


Essential Extract readable text with -dump

-dump fetches the page and prints a formatted plain-text version — ideal for reading in the terminal or piping to other tools.

Run the command:

bash
elinks -dump https://example.com

Sample output:

output
                                 Example Domain

   This domain is for use in documentation examples without needing
   permission. Avoid use in operations.

   [1]Learn more

References

   Visible links
   1. https://iana.org/domains/example

Add -no-numbering or -no-references when you want cleaner lines for grep or logging.

Essential Print raw HTML with -source

-source prints the document body as received — tags intact. Use it when you need titles, meta tags, or link URLs without a graphical browser.

Run the command:

bash
elinks -source https://example.com | head -c 400

Sample output (truncated):

text
<!doctype html><html lang="en"><head><title>Example Domain</title><link rel="icon" href="data:,"><meta name="viewport" content="width=device-width, initial-scale=1"><style>body{background:#eee;width:60vw;margin:15vh auto;font-family:system-ui,sans-serif}h1{font-size:1.5em}div{opacity:0.8}a:link,a:visited{color:#348}</style></head><body><div><h1>Example Domain</h1><p>This domain is for use in documentation examples without needing permission. Avoid use in operations.</p><p><a href="https://iana.org/domains/example">Learn more</a></p></div></body></html>

Pipe to grep to pull a title or meta line without loading the full page in an editor.

Essential Render a local HTML file

ELinks reads file:// paths and local files the same way as HTTP URLs — handy for package docs under /usr/share/doc.

Create a sample page and dump it:

bash
printf '%s\n' '<html><head><title>Lab</title></head><body><h1>Hello ELinks</h1><p>Linux text browser test.</p></body></html>' > /tmp/elinks-lab/page.html
elinks -dump /tmp/elinks-lab/page.html

Sample output:

output
                                  Hello ELinks

   Linux text browser test.

Remove the lab file when finished: rm -f /tmp/elinks-lab/page.html.

Common Save webpage text to a file

Redirect -dump stdout to capture a snapshot for diffing, cron jobs, or offline reading.

Run the command:

bash
elinks -dump https://example.com > /tmp/elinks-lab/page.txt
wc -l /tmp/elinks-lab/page.txt

Sample output:

output
11 /tmp/elinks-lab/page.txt

Inspect with less /tmp/elinks-lab/page.txt. Delete the file after testing: rm -f /tmp/elinks-lab/page.txt.

Common Filter dump output with grep

Pipe -dump into grep to keep lines that match a keyword — a simple pattern for status pages or release notes.

Run the command:

bash
elinks -dump https://example.com | grep -i example

Sample output:

output
                                 Example Domain
   This domain is for use in documentation examples without needing
   1. https://iana.org/domains/example

Combine with -no-numbering -no-references when link footers clutter the match list.

Common Extract the page title from HTML source

Titles live in the HTML head. -source plus grep pulls them without a full dump.

Run the command:

bash
elinks -source https://example.com | grep -o '<title>[^<]*</title>'

Sample output:

output
<title>Example Domain</title>

For JSON or API endpoints, curl is usually a better fit — ELinks targets HTML documents.

Common DNS lookup with -lookup

-lookup resolves a hostname and prints A/AAAA addresses — a quick sanity check from the same tool you use to browse.

Run the command:

bash
elinks -lookup example.com

Sample output:

output
172.66.147.243
104.20.23.154

Addresses can change; use dig and host for record types, reverse lookups, and resolver-specific troubleshooting beyond elinks -lookup.

Advanced Control wrap width in dump output

-dump-width sets the column width for formatted text — useful when logging to narrow terminals or fixed-width reports.

Run the command:

bash
elinks -dump-width 40 -dump https://example.com

Sample output:

output
             Example Domain

   This domain is for use in
   documentation examples without
   needing permission. Avoid use in
   operations.

   [1]Learn more

Default width depends on configuration; override per run when scripts expect a specific line length.

Advanced Print default configuration

-config-dump writes the stock ELinks configuration to stdout — a starting point before customizing colors, keys, or protocols.

Run the command:

bash
elinks -config-dump | head -8

Sample output:

output
## ELinks 0.16.1.1 configuration file

## This is ELinks configuration file. You can edit it manually,
## if you wish so, but keep in mind that this file is overwritten
## by ELinks when you save options through UI and you are out of
## luck if you want to have both your manual changes and UI changes
## preserved.

Pair with -config-help for directive descriptions. Interactive changes are saved under ~/.elinks/ by default.


Use elinks when Use something else when
  • You need a text-mode browser on a server or over SSH
  • You want readable plain text from HTML (`-dump`) for scripts or logs
  • You need raw HTML on stdout (`-source`) without a GUI
  • You are reading local HTML docs under /usr/share/doc
  • You want tabbed, menu-driven browsing in the terminal
  • You are downloading files or calling REST APIs → curl or wget
  • You only need a one-line HTTP status or headers → curl -I
  • You prefer a minimal non-interactive text browser → lynx or w3m
  • You need JavaScript-heavy pages rendered accurately → graphical browser

elinks lynx
UI Tabbed browsing, menus, Lua/Perl scripting hooks Simple, long-established text browser
Script output -dump, -source, width and reference toggles -dump, -source
Typical use Interactive sessions plus formatted dumps Quick dumps and minimal browsing
Install (Ubuntu) elinks package lynx package

Both are terminal browsers — pick elinks for richer UI and dump options; lynx when you want maximum simplicity.


What is the difference between elinks -dump and -source?

-dump renders the page for humans: headings, paragraphs, and link lists — HTML tags stripped or converted.

-source prints the raw HTML as fetched — tags, scripts, and markup intact.

Use -dump for reading or logging content; use -source when you need to parse tags (title, meta, href values) with grep or other tools.

A strong answer is:

"-dump gives formatted plain text; -source gives raw HTML. I pick dump for readability and source when I need to inspect markup."

What does elinks -anonymous do?

-anonymous restricts ELinks so it does not read or write local configuration and limits access to local files and downloads — a safer mode on shared or untrusted systems.

It does not hide your IP or provide VPN-style privacy; it reduces local side effects of the browser.

A strong answer is:

"-anonymous limits local file access and config writes — useful on shared hosts, not a replacement for a privacy VPN."

How do you browse the web over SSH?

SSH sessions usually have no graphical display. Install a text browser (elinks, lynx, or w3m) on the remote host and open a URL:

bash
elinks https://example.com

Navigation is keyboard-driven: arrows to move, Enter to follow links, q to quit. For a one-shot text snapshot without interaction, use elinks -dump URL.

A strong answer is:

"On a remote server I run elinks URL in the SSH session, or elinks -dump when I only need the text. No DISPLAY needed."


Troubleshooting

Symptom Likely cause Fix
elinks: command not found Package not installed sudo apt install elinks (Ubuntu/Debian) or distro equivalent
Blank or garbled -dump output Encoding or non-HTML content Try -dump-charset UTF-8; use curl for non-HTML APIs
SSL or certificate errors TLS trust or hostname mismatch Update CA certs; test with curl -v; fix server cert in production
-dump includes noisy link numbers Default dump formatting Add -no-numbering and/or -no-references
Interactive page looks empty JavaScript-required site Text browsers do not run JS — use a graphical browser or API
Slow on large pages Network or heavy HTML Use -dump with a timeout wrapper; fetch smaller paths

Finished reading?Beta Get the key takeaways in seconds, then ask follow-up questions
Rohan Timalsina

is a technical writer and Linux enthusiast who writes practical guides on Linux commands and system administration. He focuses on simplifying complex topics through clear explanations.

  • Linux
  • HTML5
  • JavaScript
  • Web Design
  • Front-end Web Development