w3m的使用

w3m简介

以下介绍来自百度百科

w3m是个开源的文字式网页浏览器
w3m支持表格、框架、ssl连接、颜色。如果是在适当的终端上,甚至还支持“inline image”。 这个软件通常尽量呈现出网页本来的编排。
“w3m”这名字是来自“WWW-wo-Miru”,就是日文的“看WWW”之义。
由于w3m是文字式网页浏览器,所以使用w3m浏览网页时只能显示文字,而无法显示图片、视频以及音频。

安装

ubuntu18.04上

sudo apt-get install w3m

使用

帮助

w3m version w3m/0.5.3+git20190105, options lang=en,m17n,image,color,ansi-color,mouse,gpm,menu,cookie,ssl,ssl-verify,external-uri-loader,w3mmailer,nntp,gopher,ipv6,alarm,mark,migemo
usage: w3m [options] [URL or filename]
options:
    -t tab           set tab width
    -r               ignore backspace effect
    -l line          # of preserved line (default 10000)
    -I charset       document charset
    -O charset       display/output charset
    -B               load bookmark
    -bookmark file   specify bookmark file
    -T type          specify content-type
    -m               internet message mode
    -v               visual startup mode
    -M               monochrome display
    -N               open URL of command line on each new tab
    -F               automatically render frames
    -cols width      specify column width (used with -dump)
    -ppc count       specify the number of pixels per character (4.0...32.0)
    -ppl count       specify the number of pixels per line (4.0...64.0)
    -dump            dump formatted page into stdout
    -dump_head       dump response of HEAD request into stdout
    -dump_source     dump page source into stdout
    -dump_both       dump HEAD and source into stdout
    -dump_extra      dump HEAD, source, and extra information into stdout
    -post file       use POST method with file content
    -header string   insert string as a header
    +<num>           goto <num> line
    -num             show line number
    -no-proxy        don't use proxy
    -4               IPv4 only (-o dns_order=4)
    -6               IPv6 only (-o dns_order=6)
    -no-mouse        don't use mouse
    -cookie          use cookie (-no-cookie: don't use cookie)
    -graph           use DEC special graphics for border of table and menu
    -no-graph        use ASCII character for border of table and menu
    -s               squeeze multiple blank lines
    -W               toggle search wrap mode
    -X               don't use termcap init/deinit
    -title[=TERM]    set buffer name to terminal title string
    -o opt=value     assign value to config option
    -show-option     print all config options
    -config file     specify config file
    -help            print this usage message
    -version         print w3m version
    -reqlog          write request logfile
    -debug           DO NOT USE

打开 百度 w3m www.baidu.com

In-page Navigation

key operation
space,C-v,^[[6~,+ Scroll down one page (NEXT_PAGE)
^[[5~,-,b,ESC-v Scroll up one page (PREV_PAGE)
C-f,RIGHT,l Cursor right (MOVE_RIGHT)
h,LEFT,C-b Cursor left (MOVE_LEFT)
DOWN,C-n,j Cursor down (MOVE_DOWN)
C-p,UP,k Cursor up (MOVE_UP)
<NOT ASSIGNED> Cursor right. With edge touched, slide (MOVE_RIGHT1)
<NOT ASSIGNED> Cursor left. With edge touched, slide (MOVE_LEFT1)
<NOT ASSIGNED> Cursor down. With edge touched, slide (MOVE_DOWN1)
<NOT ASSIGNED> Cursor up. With edge touched, slide (MOVE_UP1)
K Scroll the screen down one line (DOWN)
J Scroll the screen up one line (UP)
< Shift screen left (SHIFT_LEFT)
> Shift screen right (SHIFT_RIGHT)
, Shift screen one column left (LEFT)
. Shift screen one column right (RIGHT)
C-a,^ Go to the beginning of the line (LINE_BEGIN)
C-e,$ Go to the end of the line (LINE_END)
Z Center on cursor column (CENTER_H)
z Center on cursor line (CENTER_V)
ESC-g Go to the specified line (GOTO_LINE)
ESC-<,g,^[[1~ Go to the first line (BEGIN)
ESC->,^[[4~,G Go to the last line (END)
w Move to the next word (NEXT_WORD)
W Move to the previous word (PREV_WORD)
[ Move to the first hyperlink (LINK_BEGIN)
] Move to the last hyperlink (LINK_END)
TAB Move to the next hyperlink (NEXT_LINK)
ESC-TAB,C-u,^[[Z Move to the previous hyperlink (PREV_LINK)
ESC-m Pop up menu to navigate between hyperlinks (MOVE_LIST_MENU)
<NOT ASSIGNED> Move right to the next hyperlink (NEXT_RIGHT)
<NOT ASSIGNED> Move left to the next hyperlink (NEXT_LEFT)
<NOT ASSIGNED> Move downward to the next hyperlink (NEXT_DOWN)
<NOT ASSIGNED> Move upward to the next hyperlink (NEXT_UP)
<NOT ASSIGNED> Move right or downward to the next hyperlink (NEXT_RIGHT_DOWN)
<NOT ASSIGNED> Move left or upward to the next hyperlink (NEXT_LEFT_UP)
( Cancel the last cursor movement (UNDO)
) Cancel the last undo (REDO)

Hyperlink Operations

key operation
C-m,C-j Follow current hyperlink in a new buffer (GOTO_LINK)
C-t Follow current hyperlink in a new tab (TAB_LINK)
ESC-C-j,a,ESC-C-m Save hyperlink target (SAVE_LINK)
I Display image in viewer (VIEW_IMAGE)
ESC-I Save inline image (SAVE_IMAGE)
<NOT ASSIGNED> Submit form (SUBMIT)
c Show current address (PEEK)
u Show target address (PEEK_LINK)
i Show image address (PEEK_IMG)
= Display information about the current document (INFO)
C-g Display current position in document (LINE_INFO)
: Turn URL-like strings into hyperlinks (MARK_URL)
";" Turn current word into hyperlink (MARK_WORD)
ESC-: Turn Message-ID-like strings into hyperlinks (MARK_MID)
F Toggle rendering HTML frames (FRAME)
M Display using an external browser (EXTERN)
ESC-M Display target using an external browser (EXTERN_LINK)
L Show all URLs referenced (LIST)
ESC-l Pop up menu for hyperlinks to browse to (LIST_MENU)
<NOT ASSIGNED> Pop up link element menu (LINK_MENU)
<NOT ASSIGNED> Pop up accesskey menu (ACCESSKEY)

File/Stream Operations

key operation
U Open specified document in a new buffer (GOTO)
ESC-u Go to relative address (GOTO_RELATIVE)
<NOT ASSIGNED> Open specified document in a new tab (TAB_GOTO)
<NOT ASSIGNED> Open relative address in a new tab (TAB_GOTO_RELATIVE)
V Open local file in a new buffer (LOAD)
@ Execute shell command and display output (READ_SHELL)
# Execute shell command and display output (PIPE_SHELL)
| Pipe current buffer through a shell command and display output (PIPE_BUF)

Buffer Operations

key operation
B Close current buffer and return to the one below in stack (BACK)
<NOT ASSIGNED> Switch to the next buffer (NEXT)
<NOT ASSIGNED> Switch to the previous buffer (PREV)
s Pop up buffer-stack menu (SELECT_MENU)
<NOT ASSIGNED> Display buffer-stack panel (SELECT)
v Toggle between HTML shown or processed (VIEW)
ESC-s Save document source (DOWNLOAD)
S Save rendered document (SAVE_SCREEN)
E Edit local source (EDIT)
ESC-e Edit rendered copy of document (EDIT_SCREEN)
R Load current document anew (RELOAD)
<NOT ASSIGNED> Re-render document (RESHAPE)
C-l Draw the screen anew (REDRAW)
<NOT ASSIGNED> Restart loading and drawing of images (DISPLAY_IMAGE)
<NOT ASSIGNED> Stop loading and drawing of images (STOP_IMAGE)

Tab Operations

key operation
T Open a new tab (with current document) (NEW_TAB)
C-q Close tab (CLOSE_TAB)
} Switch to the next tab (NEXT_TAB)
{ Switch to the previous tab (PREV_TAB)
ESC-t Pop up tab selection menu (TAB_MENU)
<NOT ASSIGNED> Move right along the tab bar (TAB_RIGHT)
<NOT ASSIGNED> Move left along the tab bar (TAB_LEFT)

Bookmark Management

key operation
ESC-b View bookmarks (VIEW_BOOKMARK)
ESC-a Add current page to bookmarks (ADD_BOOKMARK)

Searches

key operation
/ Search forward (SEARCH_FORE)
? Search backward (SEARCH_BACK)
n Continue search forward (SEARCH_NEXT)
N Continue search backward (SEARCH_PREV)
C-s Incremental search forward (ISEARCH)
C-r Incremental search backward (ISEARCH_BACK)

Dictionary Lookup

key operation
ESC-w Execute dictionary command (see README.dict) (DICT_WORD)
ESC-W Execute dictionary command for word at cursor (DICT_WORD_AT)

Mark Operations

key operation
C-@ Set/unset mark (MARK)
ESC-n Go to the next mark (NEXT_MARK)
ESC-p Go to the previous mark (PREV_MARK)
" Mark all occurences of a pattern (REG_MARK)

Miscellaneous

key operation
^[[L,^[[28~,^[[E,^[[2~ Pop up menu (MENU)
H Show help panel (HELP)
o Display options setting panel (OPTIONS)
r Display the version of w3m (VERSION)
C-k View cookie list (COOKIE)
C-h Show browsing history (HISTORY)
D Display downloads panel (DOWNLOAD_LIST)
<NOT ASSIGNED> Change the character encoding for the current document (CHARSET)
<NOT ASSIGNED> Change the default character encoding (DEFAULT_CHARSET)
<NOT ASSIGNED> Display error messages (MSGS)
m Toggle mouse support (MOUSE_TOGGLE)
C-w Toggle wrapping mode in searches (WRAP_TOGGLE)
ESC-c Invoke w3m function(s) (COMMAND)
<NOT ASSIGNED> Set alarm (ALARM)
ESC-o Set option (SET_OPTION)
<NOT ASSIGNED> Set environment variable (SETENV)
ESC-k Define a binding between a key stroke combination and a command (DEFINE_KEY)
<NOT ASSIGNED> Reload configuration file (REINIT)
! Execute shell command and display output (EXEC_SHELL)
C-z Suspend w3m to background (INTERRUPT)
q Quit with confirmation request (QUIT)
Q Quit at once (EXIT)

User-defined key bindings

Buffer and Tab Selection Mode

key operation
j,C-n Next item
k,C-p Previous item
D Delete item
RET Select item

Input Line Editing Mode

key operation
C-f Cursor forward
C-b Cursor backward
C-h Delete previous character
C-d Delete character
C-k Delete everything after cursor
C-u Delete everything before cursor
C-a Cursor to the beginning of the line
C-e Cursor to the end of the line
C-p Fetch the previous string from the history list
C-n Fetch the next string from the history list
C-o Edit with external editor
SPC,TAB Try to complete filename
RET Accept input line

Popup Menu Mode

key operation
RIGHT,SPC,RET Select item
C-c,^[[28~,^[[2~ Close menu
DEL,C-h,LEFT One selection step backward
DOWN,j,C-n Move to the next item
k,UP,C-p Move to the previous item
K Scroll up one item
J Scroll down one item
C-a Move to the first item
C-e Move to the final item
C-v,^[[6~,C-f Go to the next page
ESC-v,^[[5~,C-b Go to the previous page
/,C-s Search forward
C-r,? Search backward
n Search for the next match
N Search for the previous match
C-z Suspend
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
禁止转载,如需转载请通过简信或评论联系作者。
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 215,294评论 6 497
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,780评论 3 391
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 161,001评论 0 351
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,593评论 1 289
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,687评论 6 388
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,679评论 1 294
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,667评论 3 415
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,426评论 0 270
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,872评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,180评论 2 331
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,346评论 1 345
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 35,019评论 5 340
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,658评论 3 323
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,268评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,495评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,275评论 2 368
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,207评论 2 352

推荐阅读更多精彩内容

  • NAME dnsmasq - A lightweight DHCP and caching DNS server....
    ximitc阅读 2,840评论 0 0
  • 文l不爱思考的牛 在我现在所在的公司,最钦佩的人便是我们的老板和老板娘。因为他俩以身作则管控着公司的每节核心,老板...
    花非物欲阅读 394评论 2 5
  • 记录几种常用的日期格式转化 Demo 1、获取当前时间,并转化成yyyy-MM-dd HH:mm:ss 格式 2、...
    二斤寂寞阅读 212评论 0 0
  • 概念 信息不对称理论是指在市场经济活动中,各类人员对有关信息的了解是有差异的;掌握信息比较充分的人员,往往处于比较...
    cnki_abe8阅读 942评论 0 6
  • After this day, many places in China go through thecoldes...
    砖缝的小草阅读 259评论 4 9