在本文中,我們將重點介紹如何使用基於文本的瀏覽器從 Linux 命令行瀏覽互聯網。 文本瀏覽器是只呈現網頁文本內容的瀏覽器,而忽略了包括 CSS 和 Javascript 在內的所有圖形內容。 這使得這些瀏覽器速度更快並消耗更少的帶寬。 然而,不利的一面是,瀏覽體驗非常沉悶,因為不像傳統的網絡瀏覽器那樣顯示圖像和視頻 Firefox 和 Google Chrome. 我們將看看 Ubuntu 18.04 終端上的 4 個基於文本的瀏覽器。
- 3米
- 猞猁
- 鏈接2
- 埃林克斯
1) w3m 工具
W3米 是一個基於文本的瀏覽器工具,可用於在 Linux 終端上瀏覽互聯網。 我們將看到如何使用它來瀏覽網頁。
首先,我們需要安裝 w3m 包
apt-get install w3m w3m-img
樣本輸出
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libid3tag0 libimlib2
Suggested packages:
cmigemo dict dict-wn dictd libsixel-bin mpv w3m-el xsel
The following NEW packages will be installed:
libid3tag0 libimlib2 w3m w3m-img
0 upgraded, 4 newly installed, 0 to remove and 629 not upgraded.
Need to get 1,437 kB of archives.
After this operation, 3,270 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
確認已安裝
dpkg -l w3m
樣本輸出
||/ Name Version Architecture Description
+++-====================-===============-===============-==============================================
ii w3m 0.5.3-26ubuntu0 amd64 WWW browsable pager with excellent tables/fram
去一個網站運行。 w3m url
為了 example
w3m www.google.com
輸出
使用 Xterm 時,您甚至可以查看圖像!!
在裡面 example 在下面,我搜索了皇家婚禮
打開新標籤
shift + T
返回一頁
shift + B
要鍵入新 URL,
shift + U
接下來輸入 URL 並按 Enter.
2) 山貓工具
這是另一個在 GNU GPLv2 許可下設計的基於文本的瀏覽器。 要安裝 Lynx,請運行
apt-get install lynx-cur
樣本輸出
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
lynx lynx-common
The following NEW packages will be installed:
lynx lynx-common lynx-cur
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 1,038 kB of archives.
After this operation, 2,792 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
安裝完成後,我們需要確認安裝是否正確。 跑
dpkg -l lynx
輸出
||/ Name Version Architecture Description
+++-====================================-=======================-=======================-=============================================================================
ii lynx 2.8.9dev8-4ubuntu1 amd64 classic non-graphical (text-mode) web browser
要啟動 Lynx,請運行
lynx
輸出
要轉到 URL,請運行。lynx url
為了 example,
lynx www.google.com
輸入 Y 繼續
3) Links2 工具
這是一個支持鼠標和點擊的圖形網絡瀏覽器。 安裝links2工具
apt-get install links2
樣本輸出
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
fontconfig fontconfig-config libcairo2 libcroco3 libdatrie1
libdirectfb-1.2-9 libdrm-amdgpu1 libdrm-intel1 libdrm-nouveau2
libdrm-radeon1 libfontconfig1 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-common
libgl1-mesa-dri libgl1-mesa-glx libglapi-mesa libgraphite2-3 libharfbuzz0b
libice6 libllvm5.0 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0
libpciaccess0 libpixman-1-0 librsvg2-2 librsvg2-common libsensors4 libsm6
libthai-data libthai0 libtxc-dxtn-s2tc0 libx11-xcb1 libxaw7 libxcb-dri2-0
libxcb-dri3-0 libxcb-glx0 libxcb-present0 libxcb-render0 libxcb-shape0
libxcb-shm0 libxcb-sync1 libxcomposite1 libxdamage1 libxfixes3 libxft2
libxi6 libxinerama1 libxmu6 libxpm4 libxrandr2 libxrender1 libxshmfence1
libxt6 libxtst6 libxv1 libxxf86dga1 libxxf86vm1 x11-utils xbitmaps xterm
安裝完成後,我們需要確認安裝是否正確。 跑
dpkg -l links2
樣本輸出
||/ Name Version Architecture Description
+++-====================================-=======================-=======================-=============================================================================
ii links2 2.12-1 amd64 Web browser running in both graphics and text mode
要訪問站點,請運行 links2 url
為了 example,
links2 www.google.com
輸出
隨意在搜索欄中搜索任何內容。 在這種情況下,我搜索了 Bionic Beaver,這是撰寫本文時最新的 Ubuntu 版本
4) eLinks 工具
最後,我們有 eLinks 命令行工具,它的使用類似於其他基於文本的瀏覽器。 安裝運行
apt-get install elinks
樣本輸出
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
elinks-doc
The following NEW packages will be installed:
elinks
訪問網站類型 elinks url
為了 example
elinks www.google.com
按 ‘Enter’ 接著說。
現在您可以繼續搜索您的主題。
我們已經研究了一些極客和精通終端的用戶可以用來訪問互聯網的基於文本的瀏覽器。 我們歡迎您嘗試一兩個並將您的想法告訴我們。 謝謝你。