← 返回命令列表

Linux command

elinks 命令

网络

复制后可按需替换文件名、目录或参数。

常用示例

Open a URL

elinks [https://example.com]

Open in a new window

elinks -new-window [https://example.com]

Dump page content

elinks -dump [https://example.com]

Dump with a specific output width

elinks -dump -dump-width [120] [https://example.com]

Open from a bookmarks file

elinks [path/to/bookmarks.html]

Start with a specific configuration

elinks -config-dir [/path/to/config]

Render HTML from stdin

echo "[<h1>Hello</h1>]" | elinks -dump

Open without loading config

elinks -no-home [https://example.com]

说明

ELinks is a feature-rich text-mode web browser for terminals. It renders HTML pages with support for tables, frames, colors, and forms, providing a usable web experience without a graphical interface. The browser supports tabbed browsing, bookmarks, history, cookies, HTTP authentication, and downloads. Navigation uses keyboard shortcuts: g for go to URL, d to download, Tab to move between links, Enter to follow links, and q to quit. ELinks can execute JavaScript (when compiled with SpiderMonkey support), handle CSS styling to some extent, and render complex layouts better than simpler browsers like Lynx. Forms, including multi-select and file uploads, work properly. The -dump mode is particularly useful for scripts, converting web pages to plain text. Combined with shell pipes, it enables command-line web scraping. The output respects terminal width and formats tables as text.

参数

-dump
Render page to stdout and exit (non-interactive).
-dump-width _n_
Width for dumped output (default: 80).
-dump-charset _codepage_
Codepage used when formatting dump output.
-source
Print page source instead of rendering.
-no-home
Don't use or create a home directory for config.
-config-dir _path_
Use alternate configuration directory.
-anonymous
Restrict to safe operations (for public terminals).
-no-connect
Run as a separate instance instead of connecting to an existing one.
-new-window
Open URL in new window instead of tab.
-remote _command_
Send command to running ELinks instance.
-localhost
Restrict to local addresses only (no remote connections).
-version
Print version information.
-help
Display help.

FAQ

What is the elinks command used for?

ELinks is a feature-rich text-mode web browser for terminals. It renders HTML pages with support for tables, frames, colors, and forms, providing a usable web experience without a graphical interface. The browser supports tabbed browsing, bookmarks, history, cookies, HTTP authentication, and downloads. Navigation uses keyboard shortcuts: g for go to URL, d to download, Tab to move between links, Enter to follow links, and q to quit. ELinks can execute JavaScript (when compiled with SpiderMonkey support), handle CSS styling to some extent, and render complex layouts better than simpler browsers like Lynx. Forms, including multi-select and file uploads, work properly. The -dump mode is particularly useful for scripts, converting web pages to plain text. Combined with shell pipes, it enables command-line web scraping. The output respects terminal width and formats tables as text.

How do I run a basic elinks example?

Run `elinks [https://example.com]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -dump do in elinks?

Render page to stdout and exit (non-interactive).