zoukankan      html  css  js  c++  java
  • 20个有趣的Linux命令

     

    写在前面:本博客为本人原创,严禁任何形式的转载!本博客只允许放在博客园(.cnblogs.com),如果您在其他网站看到这篇博文,请通过下面这个唯一的合法链接转到原文!

    本博客全网唯一合法URL:http://www.cnblogs.com/acm-icpcer/p/8450414.html

     

     

    Linux是一种乐趣

    命令1:sl(Steam Locomotive)

    你可能知道的命令“ls”,即list命令,并经常使用它来查看文件夹的内容,但由于误打字有时候你会产生“SL”,如何在终端得到一点点的乐趣,而不是“ 命令未找到 “。

    安装sl

    root@howtoing:~# apt-get install sl 		(In Debian like OS)
    root@howtoing:~# yum -y install sl 		(In Red Hat like OS)
    输出
    root@howtoing:~# sl
    sl有趣的命令

    sl命令

    当你键入'LS'而不是'ls'的这个命令也可使用。

    命令2:telnet

     !  ! 它不是看起来那么复杂。 你会熟悉的telnet。 Telnet是一种面向文本的双向网络协议。这里没有什么要安装。你应该有一个Linux盒子和一个工作的互联网。

    root@howtoing:~# telnet towel.blinkenlights.nl
    telnet命令

    telnet命令

     

    命令3:fortune

    怎么样让你的财富随意,有时在终端滑稽。

    安装财富

    root@howtoing:~# apt-get install fortune 	(for aptitude based system)
    root@howtoing:~# yum install fortune 		(for yum based system)
    root@howtoing:~# 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.

    命令4:rev(Reverse)

    给它的每一个字符串,是不是很可笑。

    root@howtoing:~# rev
    123abc 
    cba321 
    xuniL eb ot nrob
    born to be Linux

    命令5:factor

    时间为一些数学中,该命令输出一个给定号码的所有可能的因素。

    root@howtoing:~# factor 5
    5 
    5: 5 
    12 
    12: 2 2 3 
    1001 
    1001: 7 11 13 
    5442134 
    5442134: 2 2721067

    命令6:脚本

    OK罚款这不是一个命令和脚本,但它是好的。

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

    命令7:Cowsay

    在终端的ASCII母牛会说你什么都想要。

    安装Cowsay

    root@howtoing:~# apt-get install cowsay 		(for Debian based OS)
    root@howtoing:~# yum install cowsay		(for Red Hat based OS)
    输出
    root@howtoing:~# cowsay I Love nix 
    ____________
    < I Love nix >
    ------------
       ^__^
      (oo)\_______
    (__)       )/
    ||----w |
    ||     ||

    如何pipelineing“fortune命令 ”,以cowsay上述?

    root@howtoing:~# fortune | cowsay 
    _________________________________________
    / Q: How many Oregonians does it take to  
    | screw in a light bulb? A: Three. One to |
    | screw in the light bulb and two to fend |
    | off all those                           |
    |                                         |
    | Californians trying to share the        |
     experience.                             /
    -----------------------------------------
       ^__^
      (oo)\_______
    (__)       )/
    ||----w |
    ||     ||

     :'|' 被称为流水线指令,并且其被用于其中一个命令的输出需要是另一个命令的输入的地方。 在上面的例子中的“ 幸运 ”命令充当'cowsay'命令的输入的输出。此流水线指令经常用于脚本和编程。 xcowsay是一个图形化程序,它响应类似于cowsay但在一个图形化的方式,因此它是cowsay第X。

    apt-get install xcowsay
    yum install xcowsay
    输出
    root@howtoing:~# xcowsay I Love nix
    安装xcowsay

    xcowsay命令

    cowthink另一个命令只需运行“cowthink Linux是SOOO搞笑”并查看cowsay和cowthink的输出的差别。

    apt-get install cowthink
    yum install cowthink
    输出
    root@howtoing:~# cowthink ....Linux is sooo funny
    _________________________
    ( ....Linux is sooo funny )
    -------------------------
    o   ^__^
    o  (oo)\_______
    (__)       )/
    ||----w |
    ||     ||

    命令8:是的

    这是有趣的,但也是有用的,特别是在脚本和系统管理员 ,其中一个自动预定义响应可以传递给终端或产生。

    root@howtoing:~# yes I Love Linux
    I Love Linux
    I Love Linux
    I Love Linux
    I Love Linux
    I Love Linux
    I Love Linux
    I Love Linux
    I Love Linux
    I Love Linux
    I Love Linux
    I Love Linux
    I Love Linux

     :(直到你中断即CTRL + C)。

    命令9:厕所

    什么?你在开玩笑,没有!肯定不是,但肯定这个命令本身太有趣了,我不知道从这个命令得到它的名字。

    安装厕所

    root@howtoing:~# apt-get install toilet 
    root@howtoing:~# yum install toilet
    输出
    root@howtoing:~# toilet howtoing 
    mmmmmmm                        "             m                               
    #     mmm    mmm   mmmmm  mmm    m mm   mm#mm          mmm    mmm   mmmmm 
    #    #"  #  #"  "  # # #    #    #"  #    #           #"  "  #" "#  # # # 
    #    #""""  #      # # #    #    #   #    #           #      #   #  # # # 
    #    "#mm"  "#mm"  # # #  mm#mm  #   #    "mm    #    "#mm"  "#m#"  # # #

    它甚至提供某种颜色和字体样式。

    root@howtoing:~# toilet -f mono12 -F metal Howtoing.com
    安装厕所命令

    厕所命令

    注意 :Figlet是另一指令或多或少提供这样一种在终端的效果。

    命令10:cmatrix

    你可能看过好莱坞电影“ 矩阵 ”,并将与权力着迷, 得到了,看到矩阵予取予求或者你可能认为看起来都黑客的桌面动画的。

    安装cmatrix

    root@howtoing:~# apt-get install cmatrix
    root@howtoing:~# yum install cmatrix
    输出
    root@howtoing:~# cmatrix
    cmatrix命令

    cmatrix命令

     

    命令11:oneko

    OK所以你相信Linux的鼠标指针是相同的愚蠢的黑色/白色指针,没有动画的谎言,所以我害怕你可能是错的。“oneko”是一个包,将附加一个“ 杰里 ”与你的鼠标指针,并与你一起指针移动。

    安装oneko

    root@howtoing:~# apt-get install oneko
    root@howtoing:~# yum install oneko
    输出
    root@howtoing:~# oneko
    安装oneko

    oneko命令

    注意 :一旦你关闭从oneko是运行终端, 杰里会消失,也不会在启动时启动。您可以添加应用程序以启动并继续享受。

    命令12:叉子炸弹

    这是一个非常讨厌的代码。需要您自担风险运行此。 这实际上是一个叉形炸弹,其指数倍增自己,直到所有的系统资源被利用,系统挂起。 (要检查上面的代码的权力,你应该尝试了一次,但所有风险自负,关闭和保存所有其他程序和文件运行叉炸弹之前)。

    root@howtoing:~# :(){ :|:& }:

    命令13:while

    下面的“, 而”命令是一个脚本,直到你中断(Ctrl + C),它为您提供了彩色的日期和文件。只需复制并粘贴以下代码在终端。

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

    Linux while命令

    注意 :当与以下命令修改了上面的脚本,意志带给相似的输出,但有差别不大,检查一下在你的终端。

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

    命令14:espeak

    只需将多媒体扬声器的旋钮旋到完全,然后将此命令粘贴到您的终端,让我们知道你是怎么听到神的声音。

    安装espeak

    root@howtoing:~# apt-get install espeak
    root@howtoing:~# yum install espeak
    输出
    root@howtoing:~# espeak "Howtoing is a very good website dedicated to Foss Community"

    命令15:aafire

    在你的终端火如何。只要输入终端“aafire”,不带引号,看到了魔术。按任意键中断程序。

    安装aafire

    root@howtoing:~# apt-get install libaa-bin
    输出
    root@howtoing:~# aafire
    安装aafire

    aafire命令

    命令16:bb

    首先安装“apt-get的insatll bb”,然后输入“bb”,在终端,看看会发生什么。

    root@howtoing:~# bb
    bb命令

    bb命令

    命令17:url

    会不会是一个真棒感觉你,如果你可以更新你叽叽喳喳在你的朋友面前命令行状态 ,他们似乎留下深刻印象。 OK刚刚与您的用户名 , 密码和“ 你的身份信息 ”更换用户名 , 密码状态消息 。

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

    命令18:ASCIIquarium

    怎么会是让终端水族馆 。

    root@howtoing:~# apt-get install libcurses-perl
    root@howtoing:~# cd /tmp 
    root@howtoing:~# wget http://search.cpan.org/CPAN/authors/id/K/KB/KBAUCOM/Term-Animation-2.4.tar.gz
    root@howtoing:~# tar -zxvf Term-Animation-2.4.tar.gz
    root@howtoing:~# cd Term-Animation-2.4/
    root@howtoing:~# perl Makefile.PL &&  make &&   make test
    root@howtoing:~# make install
    安装ASCIIquarium

    立即下载并安装ASCIIquarium。

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

    最后运行在终端“asciiquarium”或“ 在/ usr / local / bin目录/ asciiquarium”不带引号,成为魔法将要发生在你眼前的一部分。

    root@howtoing:~# asciiquarium
    安装水族箱

    水族馆命令

     

    命令19:funny manpages

    首先安装“ 的apt-get安装搞笑,联机手册 ”,然后运行以下命令手册页。 他们中有些人可能是18岁以上 ,风险自担跑,他们都太可笑了。

    baby
    celibacy
    condom
    date
    echo
    flame
    flog
    gong
    grope, egrope, fgrope 
    party 
    rescrog 
    rm
    rtfm
    tm
    uubp
    woman (undocumented)
    xkill 
    xlart 
    sex 
    strfry
    root@howtoing:~# man baby

    命令20: Linux调整

    现在是时候让你有一些单行调整 。

    root@howtoing:~# world
    bash: world: not found
    root@howtoing:~# touch girls boo** 
    touch: cannot touch `girls boo**': Permission denied
    root@howtoing:~# nice man woman
    No manual entry for woman
    root@howtoing:~# ^How did the sex change operation go?^ 
    bash: :s^How did the sex change operation go?^ : substitution failed
    root@howtoing:~# %blow 
    bash: fg: %blow: no such job
    root@howtoing:~# make love 
    make: *** No rule to make target `love'.  Stop.
    $ [ whereis my brain?                    
    sh: 2: [: missing ]
    % man: why did you get a divorce? 
    man:: Too many arguments.
    % !:say, what is saccharine? 
    Bad substitute.
    server@localhost:/srv$ (- 
    bash: (-: command not found

    本人整理自:https://www.howtoing.com/20-funny-commands-of-linux-or-linux-is-fun-in-terminal

    TZ@home

    2018/2/16

    by the way:大年初一的,祝大家新年快乐!

  • 相关阅读:
    继承
    对象和封装
    类的无参、带参方法
    类和对象
    数组
    循环结构
    选择结构
    变量、数据类型和运算符
    快捷键
    MyEclipse与JDK的配置
  • 原文地址:https://www.cnblogs.com/acm-icpcer/p/8450414.html
Copyright © 2011-2022 走看看