Linux中國
Linux/Unix 桌面趣事:文字模式下的 ASCII 藝術與注釋繪畫
任務: 安裝 boxes
使用 apt-get 命令 在 Debian / Ubuntu Linux 中安裝 boxes:
$ sudo apt-get install boxes
輸出示例:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
boxes
0 upgraded, 1 newly installed, 0 to remove and 6 not upgraded.
Need to get 0 B/59.8 kB of archives.
After this operation, 205 kB of additional disk space will be used.
Selecting previously deselected package boxes.
(Reading database ... 224284 files and directories currently installed.)
Unpacking boxes (from .../boxes_1.0.1a-2.3_amd64.deb) ...
Processing triggers for man-db ...
Setting up boxes (1.0.1a-2.3) ...
RHEL / CentOS / Fedora Linux 用戶, 使用 yum 命令來安裝 boxes,(請先啟用 EPEL 軟體倉庫):
# yum install boxes
輸出示例:
Loaded plugins: rhnplugin
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package boxes.x86_64 0:1.1-8.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================================
Package Arch Version Repository Size
==========================================================================
Installing:
boxes x86_64 1.1-8.el6 epel 64 k
Transaction Summary
==========================================================================
Install 1 Package(s)
Total download size: 64 k
Installed size: 151 k
Is this ok [y/N]: y
Downloading Packages:
boxes-1.1-8.el6.x86_64.rpm | 64 kB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : boxes-1.1-8.el6.x86_64 1/1
Installed:
boxes.x86_64 0:1.1-8.el6
Complete!
FreeBSD 用戶可以按如下使用:
cd /usr/ports/misc/boxes/ && make install clean
或者,使用 pkg_add 命令來增加包:
# pkg_add -r boxes
在一些給定文本周圍畫出任何種類的包圍框
輸入下列命令:
echo "This is a test" | boxes
或者,指定要使用的圖案的名字:
echo -e "ntVivek Gitentvivek@nixcraft.comntwww.cyberciti.biz" | boxes -d dog
輸出示例 :

圖01: Unix / Linux: Boxes 命令來畫出各式各樣的圖案
怎麼樣輸出所有的圖案
語法如下:
boxes option
pipe | boxes options
echo "text" | boxes -d foo
boxes -l
-d 選項用來設置要使用的圖案的名字。語法如下:
echo "Text" | boxes -d design
pipe | boxes -d desig
-l 選項列出所有圖案。它顯示了在配置文件中的所有的框線設計圖,同時也顯示關於其創作者的信息。
boxes -l
boxes -l | more
boxes -l | less
輸出示例:
43 Available Styles in "/etc/boxes/boxes-config":
----------------------------------------------ada-box (Neil Bird ):
------------ -- --
-- --
------------ada-cmt (Neil Bird ):
--
-- regular Ada
-- comments
--
boy (Joan G. Stark ):
.-"""-.
/ .===.
/ 6 6 /
( ___/ )
_________ooo_______/______________
/
| joan stark spunk1111@juno.com |
| VISIT MY ASCII ART GALLERY: |
| http://www.geocities.com/SoHo/7373/ |
_______________________ooo_________/ jgs
| | |
|_ | _|
| | |
|__|__|
/-'Y'-
(__/ __)
....
...
output truncated
..
在使用 vi/vim 文本編輯器時如何通過 boxes 過濾文本?
你可以在 vi 或 vim 中使用任何外部命令,比如在這個例子中,插入當前日期和時間,輸入:
!!date
或者
:r !date
你需要在 vim 中輸入以上命令來讀取 date 命令的輸出,這將在當前行後面加入日期和時分秒:
Tue Jun 12 00:05:38 IST 2012
你可以用 boxes 命令做到同樣的功能。如下創建一個作為示例的 shell 腳本或者c程序:
#!/bin/bash
Purpose: Backup mysql database to remote server.
Author: Vivek Gite
Last updated on: Tue Jun, 12 2012
現在輸入如下(將游標移到第二行,也就是以「Purpose: ...」開頭的行)
3!!boxes
瞧,你就會看到如下的輸出 :
#!/bin/bash
/****************************************************/
/* Purpose: Backup mysql database to remote server. */
/* Author: Vivek Gite */
/* Last updated on: Tue Jun, 12 2012 */
/****************************************************/
這個短片將會給你介紹boxes命令:
參見
- boxes 幫助手冊
via: http://www.cyberciti.biz/tips/unix-linux-draw-any-kind-of-boxes-around-text-editor.html
作者:Vivek Gite 譯者:zky001 校對:wxy
本文轉載來自 Linux 中國: https://github.com/Linux-CN/archive
對這篇文章感覺如何?
太棒了
0
不錯
0
愛死了
0
不太好
0
感覺很糟
0
More in:Linux中國
捐贈 Let's Encrypt,共建安全的互聯網
隨著 Mozilla、蘋果和谷歌對沃通和 StartCom 這兩家 CA 公司處罰落定,很多使用這兩家 CA 所簽發證書的網站紛紛尋求新的證書籤發商。有一個非盈利組織可以為大家提供了免費、可靠和安全的 SSL 證書服務,這就是 Let's Encrypt 項目。現在,它需要您的幫助
Let's Encrypt 正式發布,已經保護 380 萬個域名
由於 Let's Encrypt 讓安裝 X.509 TLS 證書變得非常簡單,所以這個數量增長迅猛。
關於Linux防火牆iptables的面試問答
Nishita Agarwal是Tecmint的用戶,她將分享關於她剛剛經歷的一家公司(印度的一家私人公司Pune)的面試經驗。在面試中她被問及許多不同的問題,但她是iptables方面的專家,因此她想分享這些關於iptables的問題和相應的答案給那些以後可能會進行相關面試的人。 所有的問題和相應的答案都基於Nishita Agarwal的記憶並經過了重寫。 嗨,朋友!我叫Nishita Agarwal。我已經取得了理學學士學位,我的專業集中在UNIX和它的變種(BSD,Linux)。它們一直深深的吸引著我。我在存儲方面有1年多的經驗。我正在尋求職業上的變化,並將供職於印度的P
Lets Encrypt 已被所有主流瀏覽器所信任
旨在讓每個網站都能使用 HTTPS 加密的非贏利組織 Lets Encrypt 已經得了 IdenTrust的交叉簽名,這意味著其證書現在已經可以被所有主流的瀏覽器所信任。從這個裡程碑事件開始,訪問者訪問使用了Lets Encrypt 證書的網站不再需要特別配置就可以得到 HTTPS 安全保護了。 Lets Encrypt 的兩個中級證書 ...

















