linux 终端 浏览器_如何使用W3M从Linux终端浏览

linux 终端 浏览器_如何使用W3M从Linux终端浏览

linux 终端 浏览器

linux 终端 浏览器_如何使用W3M从Linux终端浏览

W3M is a terminal web browser for Linux. It’s got a few tricks up its sleeve, including support for images, tabs, tables, frames and other features not usually included with terminal web browsers.

W3M是Linux的终端Web浏览器。 它有很多技巧,包括对图像,选项卡,表格,框架和其他终端Web浏览器通常不包含的功能的支持。

If you’ve used Linux for a while, you probably remember using a terminal browser to Google up a solution for your hardware when the X server refused to load. Modern X servers have advanced far beyond this, but W3M and other terminal browsers can still be useful.

如果您使用Linux已有一段时间,您可能还记得当X服务器拒绝加载时,使用终端浏览器来为您的硬件提供Google解决方案。 现代的X服务器已经远远超越了它,但是W3M和其他终端浏览器仍然可以使用。

安装W3M (Installing W3M)

W3M isn’t included by default on most Linux distributions. You’ll want to install the main w3m package and the w3m-img package if you want inline image support. Use the following command on Ubuntu:

大多数Linux发行版默认都不包括W3M。 如果需要内嵌图像支持,则需要安装主w3m软件包和w3m-img软件包。 在Ubuntu上使用以下命令:

sudo apt-get install w3m w3m-img

须藤apt-get install w3m w3m-img

基本浏览 (Basic Browsing)

W3M has quite a few command-line options, but none are mandatory. The only thing you need to specify is a web page address. Want to bring up Google? Just use the w3m google.com command.

W3M有很多命令行选项,但是没有一个是必需的。 您唯一需要指定的是网页地址。 想启动Google吗? 只需使用w3m google.com命令即可。

linux 终端 浏览器_如何使用W3M从Linux终端浏览

You can use the arrow keys to move the cursor around or click at a desired location to move the cursor there. If you want to type in a text box, select the text box with your cursor and press Enter before typing your text. W3M treats your keystrokes as commands if you just start typing.

您可以使用箭头键来移动光标,或单击所需的位置以将光标移动到那里。 如果要输入文本框,请用光标选择文本框,然后在输入文本之前按Enter键。 如果您只是开始键入,W3M会将您的击键视为命令。

linux 终端 浏览器_如何使用W3M从Linux终端浏览

Load a hyperlink by selecting it with your cursor and pressing Enter. You don’t have to select hyperlinks manually — press the Tab key to position your cursor over the next hyperlink on the page.

通过使用光标选择超链接并按Enter来加载超链接。 您不必手动选择超链接,只需按Tab键即可将光标置于页面上的下一个超链接上。

linux 终端 浏览器_如何使用W3M从Linux终端浏览

Shift-B will take you back a page. If you want to load a different URL, press Shift-U and you’ll get an URL prompt. Press Shift-H to view the help page if you want to see a more complete list of keyboard shortcuts.

Shift-B将带您返回一页。 如果要加载其他URL,请按Shift-U ,然后会出现URL提示。 如果要查看更完整的键盘快捷键列表,请按Shift-H键查看帮助页面。

终端中的图像 (Images in the Terminal)

linux 终端 浏览器_如何使用W3M从Linux终端浏览

W3M supports images, so where are they? Well, terminals like GNOME Terminal and KDE’s Konsole can’t display W3M’s images. Other terminals, such as Xterm, can. W3M will also display images if you’re running it in a framebuffer console, so you don’t need an X server running to take advantage of this feature.

W3M支持图像,所以它们在哪里? 好吧,GNOME Terminal和KDE的Konsole之类的终端无法显示W3M的图像。 其他终端,例如Xterm,也可以。 如果在帧缓冲控制台中运行W3M,它还将显示图像,因此您不需要运行X服务器即可利用此功能。

linux 终端 浏览器_如何使用W3M从Linux终端浏览

Another feature that doesn’t work in GNOME Terminal or Konsole is W3M’s right-click menu.

W3M的右键单击菜单在GNOME Terminal或Konsole中不起作用的另一个功能。

linux 终端 浏览器_如何使用W3M从Linux终端浏览

浏览器标签 (Browser Tabs)

How did we ever live without tabs? They’re an essential feature for desktop web browsers. W3M includes tabs, too. Just press Shift-T to open a new tab.

我们如何过着没有标签的生活? 它们是桌面Web浏览器的基本功能。 W3M也包含选项卡。 只需按Shift-T即可打开一个新标签。

linux 终端 浏览器_如何使用W3M从Linux终端浏览

You can switch between tabs by clicking them, but we’re trying to be terminal ninjas here. Use the { and } keys to switch between tabs without touching your mouse (that’s Shift-[ and Shift-]).

您可以通过单击选项卡在它们之间切换,但是我们试图在这里成为终端忍者。 使用{}键在选项卡之间切换,而无需触摸鼠标(即Shift- [Shift-] )。

终端机中的Gmail (Gmail in the Terminal)

W3M isn’t stuck in the past, like Lynx (another web browser for the terminal) is. It can render tables, frames and even has support for Gmail’s basic HTML interface.

W3M并没有像Lynx(终端的另一个Web浏览器)那样停留在过去。 它可以呈现表格,框架,甚至支持Gmail的基本HTML界面。

linux 终端 浏览器_如何使用W3M从Linux终端浏览

You’d probably feel more comfortable accessing Gmail with an IMAP client from your terminal, but hey — it works.

您可能会觉得从终端使用IMAP客户端访问Gmail更自在,但是,嘿,它可以工作。

更多文件 (More Documentation)

In addition to pressing Shift-H to view W3M’s help page, you can view the full manual on W3M’s website. The manual lists all of W3M’s command-line switches and key bindings.

除了按Shift-H来查看W3M的帮助页面外,您还可以在W3M的网站上查看完整的手册 。 该手册列出了W3M的所有命令行开关和按键绑定。



W3M still doesn’t compare with desktop browsers — notably, it doesn’t support JavaScript. There’s an experimental w3m-js extension you can compile and install yourself, but I wouldn’t rely too much on that. Then again, do you really want JavaScript in a terminal browser?

W3M仍然无法与桌面浏览器相提并论-值得注意的是,它不支持JavaScript。 有一个实验性的w3m-js扩展,您可以编译并自行安装,但我不会太依赖它。 再说一次,您真的要在终端浏览器中使用JavaScript吗?

翻译自: https://www.howtogeek.com/103574/how-to-browse-from-the-linux-terminal-with-w3m/

linux 终端 浏览器