https://linux.cn/article-2831-1.html

1. 命令:sl (蒸汽机车)

你可能了解 ‘ls’ 命令,并经常使用它来查看文件夹的内容。但是,有些时候你可能会拼写成 ‘sl’ ,这时我们应该如何获得一些乐趣而不是看见“command not found”呢?

安装 sl

  1. root@tecmint:~# apt-get install sl (In Debian like OS)
  2. root@tecmint:~# yum -y install sl (In Red Hat like OS)

输出

  1. root@tecmint:~# sl

sl command

当你敲入的是‘LS‘而不是’ls‘时,这个命令也会运行。

2. 命令:telnet

非也!非也!!这可不像它平常那样复杂。你可能很熟悉telnet。Telnet 是一个文本化的双向网络协议。这里不需要安装什么东西。你需要的就是一个Linux系统和一个连通的网络。

  1. root@tecmint:~# telnet towel.blinkenlights.nl

telnet command

3. 命令:fortune

试试你未知的运气,终端里有时也有好玩的。

安装 fortune

  1. root@tecmint:~# apt-get install fortune (for aptitude based system)
  2. root@tecmint:~# yum install fortune (for yum based system)
  3. root@tecmint:~# fortune
  4. You're not my type. For that matter, you're not even my species!!!
  5. Future looks spotty. You will spill soup in late evening.
  6. You worry too much about your job. Stop it. You are not paid enough to worry.
  7. Your love life will be... interesting.

4. 命令:rev(翻转)

它会把传递给它的的每个字符串都反过来,是不是很好玩。

  1. root@tecmint:~# rev
  2. 123abc
  3. cba321
  4. xuniL eb ot nrob
  5. born to be Linux

5. 命令:factor

该谈点儿关于Mathematics的了,这个命令输出给定数字的所有因子。

  1. root@tecmint:~# factor
  2. 5
  3. 5: 5
  4. 12
  5. 12: 2 2 3
  6. 1001
  7. 1001: 7 11 13
  8. 5442134
  9. 5442134: 2 2721067

6.命令:script

好的,这不是什么命令,而是一个脚本,一个很有趣的脚本。

  1. root@tecmint:~# for i in {1..12}; do for j in $(seq 1 $i); do echo -ne $i x $j=$((i*j))\\t;done; echo;done
  2. 1 x 1=1
  3. 2 x 1=2 2 x 2=4
  4. 3 x 1=3 3 x 2=6 3 x 3=9
  5. 4 x 1=4 4 x 2=8 4 x 3=12 4 x 4=16
  6. 5 x 1=5 5 x 2=10 5 x 3=15 5 x 4=20 5 x 5=25
  7. 6 x 1=6 6 x 2=12 6 x 3=18 6 x 4=24 6 x 5=30 6 x 6=36
  8. 7 x 1=7 7 x 2=14 7 x 3=21 7 x 4=28 7 x 5=35 7 x 6=42 7 x 7=49
  9. 8 x 1=8 8 x 2=16 8 x 3=24 8 x 4=32 8 x 5=40 8 x 6=48 8 x 7=56 8 x 8=64
  10. 9 x 1=9 9 x 2=18 9 x 3=27 9 x 4=36 9 x 5=45 9 x 6=54 9 x 7=63 9 x 8=72 9 x 9=81
  11. 10 x 1=10 10 x 2=20 10 x 3=30 10 x 4=40 10 x 5=50 10 x 6=60 10 x 7=70 10 x 8=80 10 x 9=90 10 x 10=100
  12. 11 x 1=11 11 x 2=22 11 x 3=33 11 x 4=44 11 x 5=55 11 x 6=66 11 x 7=77 11 x 8=88 11 x 9=99 11 x 10=110 11 x 11=121
  13. 12 x 1=12 12 x 2=24 12 x 3=36 12 x 4=48 12 x 5=60 12 x 6=72 12 x 7=84 12 x 8=96 12 x 9=108 12 x 10=120 12 x 11=132 12 x 12=144

7.命令:Cowsay

一个在终端用ASCII码组成的小牛,这个小牛会说出你想要它说的话。

安装Cowsay

  1. root@tecmint:~# apt-get install cowsay (for Debian based OS)
  2. root@tecmint:~# yum install cowsay (for Red Hat based OS)

输出

  1. root@tecmint:~# cowsay I Love nix
  2. ____________
  3. < I Love nix >
  4. ------------
  5. \ ^__^
  6. \ (oo)\_______
  7. (__)\ )\/\
  8. ||----w |
  9. || ||

如果用管道将‘fortune command’命令重定向到cowsay会怎样呢?

root@tecmint:~# fortune | cowsay

  1. _________________________________________
  2. / Q: How many Oregonians does it take to \
  3. | screw in a light bulb? A: Three. One to |
  4. | screw in the light bulb and two to fend |
  5. | off all those |
  6. | |
  7. | Californians trying to share the |
  8. \ experience. /
  9. -----------------------------------------
  10. \ ^__^
  11. \ (oo)\_______
  12. (__)\ )\/\
  13. ||----w |
  14. || ||

提示:‘|’是管道命令符。通常它是将一个命令的输出作为下一个命令的输入。在上面的例子中‘fortune’的输出作为‘cowsay’命令的输出。管道命令会经常用在脚本和程序编写中。

xcowsay是一个图形界面程序。它与cowsay类似只是以一种图形的方式来表达,可以说是X版本的cowsay。

  1. apt-get insatll xcowsay
  2. yum install xcowsay

输出

  1. root@tecmint:~# xcowsay I Love nix

xcowsay command

cowthink是另一个命令。运行“cowthink Linux is sooo funny ”看看它与cowsay的不同吧。

  1. apt-get insatll cowthink
  2. yum install cowthink

输出

  1. root@tecmint:~# cowthink ....Linux is sooo funny
  2. _________________________
  3. ( ....Linux is sooo funny )
  4. -------------------------
  5. o ^__^
  6. o (oo)\_______
  7. (__)\ )\/\
  8. ||----w |
  9. || ||

8. 命令:yes

yes 是一个非常有趣又有用的命令,尤其对于脚本编写和系统管理员来说,它可以自动地生成预先定义的响应或者将其传到终端。

  1. root@tecmint:~# yes I Love Linux
  2. I Love Linux
  3. I Love Linux
  4. I Love Linux
  5. I Love Linux
  6. I Love Linux
  7. I Love Linux
  8. I Love Linux
  9. I Love Linux
  10. I Love Linux
  11. I Love Linux
  12. I Love Linux
  13. I Love Linux

提示: (直到你按下ctrl+c才停止)

9. 命令: toilet

什么?你在开玩笑吗! 当然没有,但肯定的是这个命令的名字太搞了,我也不知道这个命令的名字从何而来。

安装toilet

  1. root@tecmint:~# apt-get install toilet
  2. root@tecmint:~# yum install toilet

输出

  1. root@tecmint:~# toilet tecmint
  2. mmmmmmm " m
  3. # mmm mmm mmmmm mmm m mm mm#mm mmm mmm mmmmm
  4. # #" # #" " # # # # #" # # #" " #" "# # # #
  5. # #"""" # # # # # # # # # # # # # #
  6. # "#mm" "#mm" # # # mm#mm # # "mm # "#mm" "#m#" # # #

这个命令甚至提供了一些颜色和字体格式。

  1. root@tecmint:~# toilet -f mono12 -F metal Tecmint.com

toilet command

提示:Figlet 是另外一个与toilet产生的效果类似的命令。

10. 命令:cmatrix

你可能看多好莱坞的电影‘黑客帝国’并陶醉于被赋予Neo的能看到在矩阵中任何事物的能力,或者你会想到一幅类似于‘Hacker’的桌面的生动画面。

安装 cmatrix

  1. root@tecmint:~# apt-get install cmatrix
  2. root@tecmint:~# yum install cmatrix

输出

  1. root@tecmint:~# cmatrix

cmatrix command

11. 命令: oneko

可能你坚信Linux的鼠标指针永远是同样的黑色或白色一点儿也不生动,那你就错了。“oneko”是一个会让一个“Jerry”你的鼠标指针附着到你鼠标上的一个软件包。

安装 oneko

  1. root@tecmint:~# apt-get install oneko
  2. root@tecmint:~# yum install oneko

输出

  1. root@tecmint:~# oneko

oneko command

提示:关闭运行着oneko的终端时,Jerry也会随之消失,重新启动终端时也不会再出项。你可以将这个程序添加到启动选项中然后继续使用它。

12. Fork炸弹

这是一段非常欠抽的代码。运行这个命令的后果自己负责。这个命令其实是一个fork炸弹,它会以指数级的自乘,直到所有的系统资源都被利用了或者系统挂起(想要见识这个命令的威力你可以试一次这个命令,但是后果自负,记得在运行它之前关掉并保存其它所有程序和文件)。

  1. root@tecmint:~# :(){ :|:& }:

13. 命令:while

下面的”while“命令是一个脚本,这个脚本可以为你提供彩色的日期和文件直到你按下中断键(ctrl+c)。复制粘贴这个命令到你的终端。

  1. root@tecmint:~# while true; do echo "$(date '+%D %T' | toilet -f term -F border --gay)"; sleep 1; done

Linux while command

提示:以上脚本通过下面的修改也会产生类似的输出但是还是有点不同的,在你的终端试试吧。

  1. root@tecmint:~# while true; do clear; echo "$(date '+%D %T' | toilet -f term -F border --gay)"; sleep 1; done

14. 命令: espeak

将你的多媒体音箱的音量调到最大,然后在将这个命令复制到你的终端,来看看你听到上帝的声音时的反应吧。

安装 espeak

  1. root@tecmint:~# apt-get install espeak
  2. root@tecmint:~# yum install espeak

输出

  1. root@tecmint:~# espeak "Tecmint is a very good website dedicated to Foss Community"

15. 命令: aafire

在你的终端放一把火如何。把这个“aafire”敲到你的终端,不需要什么引号看看这神奇的一幕吧。按下任意键中指该程序。

安装 aafire

  1. root@tecmint:~# apt-get install libaa-bin

输出

  1. root@tecmint:~# aafire

16. 命令: bb

首先安装“apt-get install bb”,然后敲入“bb”看看会发生什么吧。

  1. root@tecmint:~# bb

bb command

17. 命令: url

如果在你的朋友面前用命令行来改变你的 twitter status 会不会很酷呢。用你的用户名密码你想要的状态分别替换username, password 和“your status message“就可以了。

  1. root@tecmint:~# url -u YourUsername:YourPassword -d status="Your status message" http://twitter.com/statuses/update.xml

18. ASCIIquarium

想要在终端弄一个水族馆该,怎么办?

  1. root@tecmint:~# apt-get install libcurses-perl
  2. root@tecmint:~# cd /tmp
  3. root@tecmint:~# wget http://search.cpan.org/CPAN/authors/id/K/KB/KBAUCOM/Term-Animation-2.4.tar.gz
  4. root@tecmint:~# tar -zxvf Term-Animation-2.4.tar.gz
  5. root@tecmint:~# cd Term-Animation-2.4/
  6. root@tecmint:~# perl Makefile.PL && make && make test
  7. root@tecmint:~# make install

安装 ASCIIquarium

下载并安装ASCIIquarium

  1. root@tecmint:~# cd /tmp
  2. root@tecmint:~# wget http://www.robobunny.com/projects/asciiquarium/asciiquarium.tar.gz
  3. root@tecmint:~# tar -zxvf asciiquarium.tar.gz
  4. root@tecmint:~# cd asciiquarium_1.1/
  5. root@tecmint:~# cp asciiquarium /usr/local/bin
  6. root@tecmint:~# chmod 0755 /usr/local/bin/asciiquarium

最后在终端运行“asciiquarium”或者“/usr/local/bin/asciiquarium”,记得不要加引号,神奇的一幕将在你眼前展现。

  1. root@tecmint:~# asciiquarium

aquarium command

19. 命令: funny manpages

首先安装“apt-get install funny-manpages”然后运行下面命令的man手册。其中一些

  1. baby
  2. celibacy
  3. condom
  4. date
  5. echo
  6. flame
  7. flog
  8. gong
  9. grope, egrope, fgrope
  10. party
  11. rescrog
  12. rm
  13. rtfm
  14. tm
  15. uubp
  16. woman (undocumented)
  17. xkill
  18. xlart
  19. sex
  20. strfry
  21. root@tecmint:~# man baby

20. Linux Tweaks

该到了做一些优化的时候了

  1. root@tecmint:~# world
  2. bash: world: not found
  3. root@tecmint:~# touch girls\ boo**
  4. touch: cannot touch `girls boo**`: Permission denied
  5. root@tecmint:~# nice man woman
  6. No manual entry for woman
  7. root@tecmint:~# ^How did the sex change operation go?^
  8. bash: :s^How did the sex change operation go?^ : substitution failed
  9. root@tecmint:~# %blow
  10. bash: fg: %blow: no such job
  11. root@tecmint:~# make love
  12. make: *** No rule to make target `love`. Stop.
  13. $ [ whereis my brain?
  14. sh: 2: [: missing ]
  15. % man: why did you get a divorce?
  16. man:: Too many arguments.
  17. % !:say, what is saccharine?
  18. Bad substitute.
  19. server@localhost:/srv$ \(-
  20. bash: (-: command not found

Linux总是sexy:who | grep -i blonde | date; cd ~; unzip; touch; strip; finger; mount; gasp; yes; uptime; umount; sleep(如果你知道我的意思,汗!)

还有一些其它的命令,只是这些命令并不能在所有的系统上运行,所以本文没有涉及到。比如说dog , filter, banner

使用愉快,你可以稍后再对我说谢谢:)您的评价是我们前进的不竭动力。告诉我们你最喜欢的命令。继续关注,不久我会有另一篇值得阅读的文章。

转 Linux命令及Linux终端的20个趣事的更多相关文章

  1. 20个Linux命令及Linux终端的趣事

    20个Linux命令及Linux终端的趣事 . 命令:sl (蒸汽机车) 你可能了解 ‘ls’ 命令,并经常使用它来查看文件夹的内容.但是,有些时候你可能会拼写成 ‘sl’ ,这时我们应该如何获得一些 ...

  2. 有趣的Linux命令,让终端炫起来

    10条真心有趣的Linux命令 动画演示10个有趣但毫无用处的Linux命令 11个无用而有趣的Linux终端彩蛋 lolcat :一个在 Linux 终端中输出彩虹特效的命令行工具

  3. Linux命令格式、终端类型和获取帮助的方法

    Linux用户类型 Root用户:超级管理员,权限很大 普通用户:权限有限 终端 terminal 终端类型 物理终端:鼠标.键盘.显示器 虚拟终端:软件模拟出来的终端 控制台终端: /dev/con ...

  4. 转: 如何用linux命令修改linux主机ip网关子网掩码

    linux一般使用ifconfig命令修改linux主机的ip.网关或子网掩码. 1.命令格式: ifconfig [网络设备] [参数] 2.命令功能: ifconfig 命令用来查看和配置网络设备 ...

  5. php 运行linux命令 与 linux下命令行执行php

    1.php运行linux命令 exec函数:string exec(string command, string [array], int [return_var]);  执行函数后不输出结果,返回最 ...

  6. linux 命令——25 linux文件属性详解

    Linux 文件或目录的属性主要包括:文件或目录的节点.种类.权限模式.链接数量.所归属的用户和用户组.最近访问或修改的时间等内容.具体情况如下: 命令: ls -lih 输出: [root@loca ...

  7. 【Linux命令】Linux压缩及解压命令

    Linux压缩及解压命令 一.文件打包和压缩命令介绍 linux系统文件压缩格式,常用的有*.tar.gz.*.gz.*.zip.*.tar,还有*.rar..7z..bz2..tar.xz..tar ...

  8. 【Linux命令】Linux命令后面所接选项和参数的区别

    Linux命令后面所接选项和参数的区别 在使用Linux命令时,有时候后面会跟一些"选项"(options)或"参数"(agruments) 命令格式为: #中 ...

  9. Linux 命令之 linux 四剑客

    Linux命令-- 四剑客 一:Linux命令 之 AWK 符号:^ 开头 $ 结尾 awk 是一种处理文本的语言,一个强大的文本分析命令! 1:提取文件中的每行的第二个 提取前文本中内容为  命令: ...

随机推荐

  1. css 之position用法详解

    css  之position用法详解: http://www.jb51.net/web/77495.html

  2. 如何在linux下解压缩rar和zip格式的文件压缩包

    转载:http://oldboy.blog.51cto.com/2561410/597515 使用apt-get安装:  sudo apt-get install  rar  zip rar使用: 将 ...

  3. JavaWeb中的简单分页

    这次主要是讲解一下通过登录后对得到的数据进行分页,首先我们新建一个登录页面login.jsp,因为我们主要学习一下分页,所以登录验证的部分不再阐述,主要代码如下: <form action=&q ...

  4. python django第二弹

    每天晚上应该就这样坐着,然后把每天的东西做个总结,或大或小,有的人可能愿意把自己的东西保留在草稿箱,想想我还是把他写出来吧,前几次我发现又遇到了之前遇到的简单的问题,翻看自己之前写的几篇小日记,可以很 ...

  5. [改善Java代码]使用package-info类为包服务

    建议50: 使用package-info类为包服务 Java中有一个特殊的类:package-info类,它是专门为本包服务的,为什么说它特殊呢?主要体现在3个方面: (1)它不能随便被创建 在一般的 ...

  6. 关于JDK中正则表达式

    正则表达式的构造摘要 构造 匹配     字符 x 字符 x \\ 反斜线字符 \0n 带有八进制值 0 的字符 n (0 <= n <= 7) \0nn 带有八进制值 0 的字符 nn ...

  7. js如何判断一个数组中是否有重复的值

    引自:http://bbs.tianya.cn/post-414-38497-1.shtml 方法一: var ary = new Array("111","22&quo ...

  8. MySql索引的优缺点

    优点 有了索引.对于记录数量很多的表,可以提高查询速度. 缺点 索引是占用空间的. 索引会影响update insert delete速度 ALERT!!! 1.索引要创建在where和join用到的 ...

  9. CSS之颜色英文代码全集

    ColorHex在线颜色查询 <head> <title>CSS之颜色英文代码全集</title> <style type="text/css&qu ...

  10. oracle视图索引

    reate table fleet_header(  day date,name varchar2(20),  route_id number(5),fleet_id number(5)); crea ...