Linux运维常用命令 各种有趣的命令和彩蛋
小作 2018-03-05 来源 :网络 阅读 1246 评论 0

摘要:本篇Linux运维常用命令 将会大家讲解各种有趣的命令和彩蛋,看完这篇文章会让你对linux的命令更加清晰的理解和运用。

本篇Linux运维常用命令 将会大家讲解各种有趣的命令和彩蛋,看完这篇文章会让你对linux的命令更加清晰的理解和运用。

screenfetch

一个显示系统信息和主题信息的命令

使用方法
输入screenfetch
效果图

                                       bboysoul@bboysoul   MMMMMMMMMMMMMMMMMMMMMMMMMmds+.        OS: Mint 18.1 serena   MMm----::-://////////////oymNMd+`     Kernel: x86_64 Linux 4.4.0-57-generic   MMd      /++                -sNMd:    Uptime: 2h 36m   MMNso/`  dMM    `.::-. .-::.` .hMN:   Packages: 2557   ddddMMh  dMM   :hNMNMNhNMNMNh: `NMm   Shell: bash 4.3.46       NMm  dMM  .NMN/-+MMM+-/NMN` dMM   Resolution: 1920x1080       NMm  dMM  -MMm  `MMM   dMM. dMM   DE: Cinnamon 3.2.7       NMm  dMM  -MMm  `MMM   dMM. dMM   WM: Muffin       NMm  dMM  .mmd  `mmm   yMM. dMM   WM Theme: macOS Sierra (macOS Sierra)       NMm  dMM`  ..`   ...   ydm. dMM   GTK Theme: macOS Sierra [GTK2/3]       hMM- +MMd/-------...-:sdds  dMM   Icon Theme: Flat Remix       -NMm- :hNMNNNmdddddddddy/`  dMM   Font: Noto Sans Bold 17        -dMNs-``-::::-------.``    dMM   CPU: Intel Core i5-5200U CPU @ 2.7GHz         `/dMNmy+/:-------------:/yMMM   GPU: Mesa DRI Intel(R) HD Graphics 5500 (Broadwell GT2)             ./ydNMMMMMMMMMMMMMMMMMMMMM   RAM: 1636MiB / 3866MiB               \.MMMMMMMMMMMMMMMMMMM

linuxlogo

显示linux版本logo图片及系统信息

使用方法
输入linuxlogo
效果图

        _,met$$$$$gg.                                                                  ,g$$$$$$$$$$$$$$$P.                                                             ,g$$P""       """Y$$.".                                                          ,$$P'              `$$$.                                                        ',$$P       ,ggs.     `$$b:                                                       `d$$'     ,$P"'   .    $$$                               ,#.                       $$P      d$'     ,    $$P      ##:          :##        :###:                      $$:      $$.   -    ,d$$'      ##'          `##         `#'                       $$;      Y$b._   _,d$P'    __  ##     __     ##  __      _     __          _      Y$$.    `.`"Y$$$$P"'     ,####:##  ,######.  ##.#####. :### ,######. ###.####:    `$$b      "-.__         ,##' `###  ##:  :##  ###' `###  ##' #:   `## `###' `##:    `Y$$b                  ##    `##  ##    ##  ##'   `##  ##    ___,##  ##:   `##     `Y$$.                 ##     ##  #######:  ##     ##  ##  .#######  ##'    ##       `$$b.               ##     ##  ##'       ##     ##  ##  ##'  `##  ##     ##         `Y$$b.            ##.   ,##  ##        ##    ,##  ##  ##    ##  ##     ##           `"Y$b._         :#:._,###  ##:__,##  ##:__,##' ,##. ##.__:##. ##     ##               `""""       `:#### ###  ######'  `######'  #### `#####"## ##     ##    Linux Version 4.4.0-57-generic, Compiled #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016          Four 2.2GHz Intel i5 Processors, 3.9GB RAM, 17558 Bogomips Total                                      bboysoul

查看内置的所有图案

bboysoul@bboysoul ~/桌面 $ linux_logo -f -L list    Available Built-in Logos:      Num    Type    Ascii    Name        Description      1    Classic    Yes    aix        AIX Logo      2    Classic    Yes    bsd        FreeBSD Logo      3    Banner    Yes    bsd_banner    FreeBSD Logo      4    Classic    Yes    irix        Irix Logo      5    Classic    Yes    openbsd        OpenBSD Logo      6    Banner    Yes    openbsd_banner    OpenBSD Logo      7    Banner    Yes    solaris        The Default Banner Logos      8    Banner    Yes    banner-simp    Simplified Banner Logo      9    Banner    Yes    banner        The Default Banner Logo      10    Classic    Yes    classic-nodots    The Classic Logo, No Periods      11    Classic    Yes    classic-simp    Classic No Dots Or Letters      12    Classic    Yes    classic        The Default Classic Logo      13    Classic    Yes    core        Core Linux Logo      14    Banner    Yes    debian_banner_2    Debian Banner 2      15    Banner    Yes    debian_banner    Debian Banner (white)       16    Classic    Yes    debian_old    Debian Old Penguin Logos       17    Classic    Yes    debian        Debian Swirl Logos      18    Classic    Yes    gnu_linux    Classic GNU/Linux      19    Banner    Yes    mandrake_banner    Mandrake(TM) Linux Banner      20    Banner    Yes    mandrake    Mandrakelinux(TM) Banner      21    Banner    Yes    mandriva    Mandriva(TM) Linux Banner      22    Banner    Yes    pld        PLD Linux banner      23    Classic    Yes    raspi        An ASCII Raspberry Pi logo      24    Banner    Yes    redhat        RedHat Banner (white)       25    Banner    Yes    slackware    Slackware Logo      26    Banner    Yes    sme        SME Server Banner Logo      27    Banner    Yes    sourcemage_ban    Source Mage GNU/Linux banner      28    Banner    Yes    sourcemage    Source Mage GNU/Linux large      29    Banner    Yes    suse        SUSE Logo      30    Banner    Yes    ubuntu        Ubuntu Logo    Do "linux_logo -L num" where num is from above to get the appropriate logo.  Remember to also use -a to get ascii version.

指定输出图案

bboysoul@bboysoul ~/桌面 $ linux_logo -f -L 3                   ,        ,              /(        )`              \ \___   / |              /- _  `-/  '             (/\/ \ \   /\             / /   | `    \             O O   ) /    |             `-^--'`<     '            (_.)  _  )   /             `.___/`    /               `-----' /  <----.     __ / __   \  <----|====O)))==) \) /====  <----'    `--' `.__,' \               |        |                \       /       /\           ______( (_  / \______/         ,'  ,-----'   |         `--{__________)    Linux Version 4.4.0-57-generic, Compiled #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016         Four 2.51GHz Intel i5 Processors, 3.9GB RAM, 17558 Bogomips Total                                      bboysoul

循环输出
for ((i=1;i<=30;i++));do linux_logo -f -L $i;sleep 0.1;done

让终端变得有意思

1. 在终端输入sudo visudo

2. 在“Defaults”末尾(文件的前半部分)添加一行“Defaults insults”。

3. 保存
之后当你使用sudo,在输入密码的时候,如果输入错误了,那么终端开始胡说八道了
演示

4. 

bboysoul@bboysoul ~/桌面 $ sudo ls  [sudo] bboysoul 的密码:   Have a gorilla...  [sudo] bboysoul 的密码:   And with that remarks folks, the case of the Crown vs yourself was proven.  [sudo] bboysoul 的密码:   sudo: 3 次错误密码尝试  bboysoul@bboysoul ~/桌面 $ sudo ls  [sudo] bboysoul 的密码:   My pet ferret can type better than you!  [sudo] bboysoul 的密码:   Your mind just hasn't been the same since the electro-shock, has it?  [sudo] bboysoul 的密码:   sudo: 3 次错误密码尝试  bboysoul@bboysoul ~/桌面 $

5. 

sl

当你输入sl或者LS后屏幕会跑出一个蒸汽火车出来

不信你试试

cmatrix

这个命令的作用就是让终端显示和黑客帝国一样的滚动的文字

用法
在终端输入cmatrix

rev

这个命令可以将所有的文本逆序输出

演示

bboysoul@bboysoul ~/桌面 $ echo bboysoul is a bad guy  bboysoul is a bad guy  bboysoul@bboysoul ~/桌面 $ echo bboysoul is a bad guy | rev  yug dab a si luosyobb

lolcat

这个命令可以让你输出的文字变为彩色

演示

bboysoul@bboysoul ~/桌面 $ echo bboysoul is a bad guy | lolcat  bboysoul is a bad guy

当然上面的输出是不会变成彩色的

 Cowsay

cowsay 是一个打印一头牛然后让那头牛说出任何你想说的话的命令

演示

bboysoul@bboysoul ~/桌面 $ cowsay bboysoul is a bad guy   _______________________  < bboysoul is a bad guy >   -----------------------          \   ^__^           \  (oo)\_______              (__)\       )\/\                  ||----w |                  ||     ||

apt-get moo

这个彩蛋和cowsay 差不多也是打印一头牛,不过你不能让这头牛说出你想说的话

演示

bboysoul@bboysoul ~/桌面 $ apt-get moo                    (__)                    (oo)              /------\/             / |    ||              *  /\---/\               ~~   ~~     ..."Have you mooed today?"...

aptitude moo

如果你把moo放在aptitude后面会怎么样呢?,如果你再在moo后加上-v或-vv或-vvv或者跟多的v呢?

演示

bboysoul@bboysoul ~/桌面 $ aptitude moo  这个程序里没有复活节彩蛋。  bboysoul@bboysoul ~/桌面 $ aptitude moo -v  这个程序里确实没有复活节彩蛋。  bboysoul@bboysoul ~/桌面 $ aptitude moo -vv  我不是已经告诉你这个程序里没有复活节彩蛋了吗?  bboysoul@bboysoul ~/桌面 $ aptitude moo -vvv  停下来!  bboysoul@bboysoul ~/桌面 $ aptitude moo -vvvv  好吧,好吧,如果我给你复活节彩蛋,你会停手吗?  bboysoul@bboysoul ~/桌面 $ aptitude moo -vvvvv  好吧,你赢了。                                   /----\                         -------/      \                        /               \                       /                |     -----------------/                  --------\     ----------------------------------------------  bboysoul@bboysoul ~/桌面 $ aptitude moo -vvvvvv  这是什么?当然是一只大象被一条蛇吞了。

fortune

这个命令会随机输出一段话

演示

bboysoul@bboysoul ~/桌面 $ fortune   No live organism can continue for long to exist sanely under conditions of  absolute reality; even larks and katydids are supposed, by some, to dream.  Hill House, not sane, stood by itself against its hills, holding darkness  within; it had stood so for eighty years and might stand for eighty more.  Within, walls continued upright, bricks met neatly, floors were firm, and  doors were sensibly shut; silence lay steadily against the wood and stone  of Hill House, and whatever walked there, walked alone.          -- Shirley Jackson, "The Haunting of Hill House"

如果你安装了fortune-zh,你在终端输入fortune-zh后,会输出唐诗三百首

演示

bboysoul@bboysoul ~/桌面 $ fortune-zh  《登楼》  作者:杜甫  花近高楼伤客心,万方多难此登临。  锦江春色来天地,玉垒浮云变古今。  北极朝廷终不改,西山寇盗莫相侵。  可怜后主还祠庙,日暮聊为梁父吟。

注:此时再敲入fortune回车,输出的内容包括中、英文,你可以将它和lolcat,rev,cowsay一起使用,除此之外和cowsay类似的命令有xcowsay和cowthink

toilet

它是能用字母拼写出更大字母的工具,figlet这个工具和它差不多

演示

bboysoul@bboysoul ~/桌面 $ toilet bboysoul is a bad guy     #      #                                         ""#             "             #mmm   #mmm    mmm   m   m   mmm    mmm   m   m    #           mmm     mmm     #" "#  #" "#  #" "#  "m m"  #   "  #" "#  #   #    #             #    #   "    #   #  #   #  #   #   #m#    """m  #   #  #   #    #             #     """m    ##m#"  ##m#"  "#m#"   "#    "mmm"  "#m#"  "mm"#    "mm         mm#mm  "mmm"                          m"                                                                            ""                                                                               #                 #                                               mmm          #mmm    mmm    mmm#          mmmm  m   m  m   m                  "   #         #" "#  "   #  #" "#         #" "#  #   #  "m m"                  m"""#         #   #  m"""#  #   #         #   #  #   #   #m#                   "mm"#         ##m#"  "mm"#  "#m##         "#m"#  "mm"#   "#                                                               m  #          m"                                                                ""          ""

aafire

这个会在屏幕上显示除一团燃烧着的火焰

安装
sudo apt install libaa-bin
只要在终端中输入aafire就可以查看到一团火焰了

oneko

如果你觉得每天对着屏幕很无聊,那这个命令就可以帮助你了,向终端中输入oneko,会跳出一只小猫来陪你玩耍

xeyes

输入这个命令屏幕上会显示出一只眼睛,眼睛还会跟着鼠标转

bb

这个命令不知道怎么介绍,去尝试一下吧,到最后会放出一些音乐的

pv

你是不是经常在电影中看到一串字匀速的显示出来,好像有人在打键盘,pv命令可以做到

演示

bboysoul@bboysoul ~/桌面 $ echo bboysoul is a bad guy | pv -qL 10  bboysoul is a bad guy

当然在这里是显示不出动画的

rig

这个命令会随机显示出一些人名,地名记录等

演示

bboysoul@bboysoul ~/桌面 $ rig  Terry Howe  215 Shalton Dr  Ames, IA  50010  (515) xxx-xxxx

yes

在这个命令后跟上文字会一直输出这些文字

演示

bboysoul@bboysoul ~/桌面 $ yes bboysoul is a bad guy  bboysoul is a bad guy  bboysoul is a bad guy  bboysoul is a bad guy  bboysoul is a bad guy  bboysoul is a bad guy  bboysoul is a bad guy  bboysoul is a bad guy  bboysoul is a bad guy  bboysoul is a bad guy  bboysoul is a bad guy  bboysoul is a bad guy  bboysoul is a bad guy

cal

这个命令可以打印日历

演示

bboysoul@bboysoul ~/桌面 $ cal        一月 2017           日 一 二 三 四 五 六     1  2  3  4  5  6  7     8  9 10 11 12 13 14    15 16 17 18 19 20 21    22 23 24 25 26 27 28    29 30 31

factor

这个命令可以分解因数

演示

bboysoul@bboysoul ~/桌面 $ factor 15  15: 3 5  bboysoul@bboysoul ~/桌面 $ factor 12  12: 2 2 3

telnet

这个不是有趣的命令,但是你可以用它来看星球大战

用法

telnet towel.blinkenlights.nl

espeak

这个会把在它后面的字符都读出来

用法

espeak bboysoul is a bad guy

好玩的命令总结得差不多了,如果有要补充的欢迎联系我继续添加

 

希望这篇文章可以帮助到你。总之,同学们,你想要的职坐标IT频道都能找到!

本文由 @小作 发布于职坐标。未经许可,禁止转载。
喜欢 | 0 不喜欢 | 0
看完这篇文章有何感觉?已经有0人表态,0%的人喜欢 快给朋友分享吧~
评论(0)
后参与评论

您输入的评论内容中包含违禁敏感词

我知道了

助您圆梦职场 匹配合适岗位
验证码手机号,获得海同独家IT培训资料
选择就业方向:
人工智能物联网
大数据开发/分析
人工智能Python
Java全栈开发
WEB前端+H5

请输入正确的手机号码

请输入正确的验证码

获取验证码

您今天的短信下发次数太多了,明天再试试吧!

提交

我们会在第一时间安排职业规划师联系您!

您也可以联系我们的职业规划师咨询:

小职老师的微信号:z_zhizuobiao
小职老师的微信号:z_zhizuobiao

版权所有 职坐标-一站式AI+学习就业服务平台 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
 沪公网安备 31011502005948号    

©2015 www.zhizuobiao.com All Rights Reserved