| 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 |
elinks — quick reference
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 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 |
elinks — command syntax
Synopsis from elinks -help on Ubuntu 25.04 (ELinks 0.16.1.1):
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 sudo apt install elinks on Ubuntu if the command is missing.
elinks — command examples
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:
elinks -dump https://example.comSample 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/exampleAdd -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:
elinks -source https://example.com | head -c 400Sample output (truncated):
<!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:
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.htmlSample 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:
elinks -dump https://example.com > /tmp/elinks-lab/page.txt
wc -l /tmp/elinks-lab/page.txtSample output:
11 /tmp/elinks-lab/page.txtInspect 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:
elinks -dump https://example.com | grep -i exampleSample output:
Example Domain
This domain is for use in documentation examples without needing
1. https://iana.org/domains/exampleCombine 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:
elinks -source https://example.com | grep -o '<title>[^<]*</title>'Sample 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:
elinks -lookup example.comSample output:
172.66.147.243
104.20.23.154Addresses can change; use dig or host for full DNS detail when troubleshooting.
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:
elinks -dump-width 40 -dump https://example.comSample output:
Example Domain
This domain is for use in
documentation examples without
needing permission. Avoid use in
operations.
[1]Learn moreDefault 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:
elinks -config-dump | head -8Sample 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.
elinks — when to use / when not
| Use elinks when | Use something else when |
|---|---|
|
|
elinks vs lynx
| 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.
elinks — interview corner
What is elinks used for in Linux?
ELinks is a text-mode web browser. It renders HTML as plain text in the terminal — no GUI required. Admins use it on servers and over SSH to read documentation sites, check that a URL loads, or extract page text.
For automation, -dump prints a formatted text version and -source prints raw HTML. Both exit without opening the interactive UI.
A strong answer is:
"elinks is a terminal web browser. I use -dump for readable text in scripts, -source for HTML, and interactive mode when I'm on a headless server and need to follow links with the keyboard."
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."
When would you use elinks instead of curl?
curl transfers URLs and is best for APIs, headers, file downloads, and precise HTTP control.
elinks understands HTML layout: -dump produces readable text with link references; interactive mode lets you follow links in the terminal.
Use elinks when the deliverable is rendered page text or interactive browsing. Use curl for HTTP semantics, JSON, binary downloads, and authentication headers.
A strong answer is:
"curl for HTTP/API work; elinks when I need HTML rendered as text or a text browser on a server."
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:
elinks https://example.comNavigation 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 |
