← 返回命令列表

Linux command

w3m 命令

网络

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

常用示例

Open a URL

w3m [https://example.com]

Open a local file

w3m [file.html]

Dump page as text

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

Dump with source

w3m -dump_source [https://example.com]

Render HTML from stdin

cat [file.html] | w3m -T text/html

Open in monochrome

w3m -M [https://example.com]

Use specific browser width

w3m -cols [80] -dump [https://example.com]

Open bookmark file

w3m -B

说明

w3m is a text-based web browser that runs in the terminal. It renders HTML pages with tables, frames, and images (when using appropriate terminal), making it one of the most capable terminal browsers. The browser supports tabs, bookmarks, cookies, and form input. It can also be used as a pager (like less) for local HTML files. The -dump option makes it useful for converting HTML to plain text in scripts. w3m handles both HTTP and HTTPS, supports basic authentication, and can work with external programs for downloading and image display.

参数

-dump
Dump rendered page to stdout and exit.
-dump_source
Dump HTML source to stdout.
-T _type_
Specify content type.
-cols _num_
Set display width.
-M
Monochrome mode.
-B
Open bookmark file.
-m
Use mouse in certain terminals.
-cookie
Enable cookies.
-no-cookie
Disable cookies.
-pauth _user:pass_
Proxy authentication.
-N
Open multiple URLs in tabs.
-I _encoding_
Specify document input character encoding.
-O _encoding_
Specify output character encoding for dump.
-o _option=value_
Set configuration option.

FAQ

What is the w3m command used for?

w3m is a text-based web browser that runs in the terminal. It renders HTML pages with tables, frames, and images (when using appropriate terminal), making it one of the most capable terminal browsers. The browser supports tabs, bookmarks, cookies, and form input. It can also be used as a pager (like less) for local HTML files. The -dump option makes it useful for converting HTML to plain text in scripts. w3m handles both HTTP and HTTPS, supports basic authentication, and can work with external programs for downloading and image display.

How do I run a basic w3m example?

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

What does -dump do in w3m?

Dump rendered page to stdout and exit.