有趣的 Linux 命令行工具
Linux is fun! Huhhh. OK so you don't believe me. Mind me at the end of this article you will have to believe that Linux is actually a fun box.
Linux 是非常有趣的,别不相信 —— 看完这篇文章,你一定会发现 Linux 系统神奇的用法。
请注意,下面部分命令给出了两种包管理软件的安装方式,如果是 Debian 系的系统,请使用 apt
,如果是 Red Hat 系的系统,请使用 yum
。如果你使用了其他 Linux 发行版,或使用了其他包管理工具(例如 macOS 上的 brew),可能无法找到所有这些命令。
注:为了在代码块中区别输入输出,以 $
开头的行代表输入,其它行代表输出。
curl
命令:curl
curl 用于互联网传输数据,支持多种协议。通过以下命令可以查看天气:1
$ curl -4 http://wttr.in
sl (Steam Locomotive)
命令:sl(蒸汽机车的缩写)
You might be aware of command 'ls' the list command and use it frequently to view the contents of a folder but because of miss-typing sometimes you would result in 'sl', how about getting a little fun in terminal and not command not found
.
你一定知道 ls 是用来显示文件夹内容的常见命令,但如果不小心打成 sl 呢?通过包管理工具安装它,你就能看见一辆跑过屏幕的火车,而不是「找不到命令」:1
2
3$ apt install sl #In Debian like OS, or aptitude based system
$ yum install sl #In Red Hat like OS, or yum based system
$ sl
This command works even when you type 'LS' and not 'ls'.
telnet
命令:telnet
No! No!! it is not as much complex as it seems. You would be familiar with telnet. Telnet is a text-oriented bidirectional network protocol over network. Here is nothing to be installed. What you should have is a Linux box and a working Internet.
不!它并不像看上去那样复杂。你会熟悉它的。Telnet 是一个基于文本的双向网络协议。你无需安装它,只需要一台能够联网的 linux 机器就行。
输入以下命令即可观看 ASCII 版星球大战:1
$ telnet towel.blinkenlights.nl
而以下命令将会在你的命令行中生成一个 ASCII 世界地图:1
$ telnet mapscii.me
是不是很有趣?
fortune
命令:fortune What about getting your random fortune, sometimes funny in
terminal.
在终端获取随机的人生经验,听上去不错吧?1
2
3
4
5
6
7
8$ apt install fortune
$ yum install fortune
$ fortune
You're not my type. For that matter, you're not even my species!!!
Future looks spotty. You will spill soup in late evening.
You worry too much about your job. Stop it. You are not paid enough to worry.
Your love life will be... interesting.