5

w3m常用操作

 2 years ago
source link: https://www.lujun9972.win/blog/2016/12/11/w3m%E5%B8%B8%E7%94%A8%E6%93%8D%E4%BD%9C/index.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

w3m命令行参数说明

w3m的命令行格式是这样的:

w3m [options] [file|URL]

若启动时指定了file或者URL,则w3m启动时立即打开指定的file或URL

若启动时没有指定file或URL,则stdin被重定向的情况下,w3m会显示重定向源中的内容(不做render). 否则,w3m会在stderr输出帮助信息后退出.

w3m <<EOF
<h>hello</h>
EOF
<h>hello</h>

w3m本身也支持大量的参数,比较常用的几个参数有:

+<line number>启动后,跳转到指定行 -t width指定tab的宽度,默认为8 -T type

指定读取文档的类型(content-type). 例如以下命令会显示渲染后的结果

w3m -T text/html <<EOF
<h>hello</h>
EOF
hello
-B启动时进入w3m的书签页 -bookmark file 指定w3m使用的书签页文件 -cookie开启cookie支持 -no-cookie禁止使用cookie -pauth username:password -num -dump从URL或file中读取内容,并将渲染的结果输出到stdout中. 结果的宽度默认为80,不过可以通过cols参数修改. -cols width指定渲染文档的宽度 -dump_sourcedump出源码 -dump_headerdump出http头信息 -dump_both同时dump出http头信息与源码 -dump_extra同时dump出extra,header与source -post file用post的方法访问URL,其中POST的内容由file指定 -header string访问URL时,将string添加到http头信息中 -no-proxy不使用代理 -no-mouse不使用鼠标 -config file指定w3m的配置文件,默认为 ~/.w3m/config -o option=value指定option的值,option的名词与值应该是w3m配置文件中的合法值

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK