温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Linux的cowsay命令怎么用

发布时间:2022-02-16 17:10:53 来源:亿速云 阅读:209 作者:iii 栏目:开发技术

这篇文章主要介绍了Linux的cowsay命令怎么用的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇Linux的cowsay命令怎么用文章都会有所收获,下面我们一起来看看吧。

Linux的cowsay命令怎么用

使用方法

dnf install cowsay

简单使用:

[root@ansible cowsay]# cowsay hellow world!_______________

---------------
       \   ^__^
        \  (oo)\_______
           (__)\       )\/\
               ||----w |
               ||     ||
[root@ansible cowsay]#

查询所有能用动物

root@ansible ~]# cowsay -lCow files in /usr/share/cowsay:
beavis.zen blowfish bud-frogs bunny cheese cower default dragon
dragon-and-cow elephant elephant-in-snake eyes flaming-sheep ghostbusters
head-in hellokitty kiss kitty koala kosh luke-koala mech-and-cow meow milk
moofasa moose mutilated ren sheep skeleton small stegosaurus stimpy
supermilker surgery telebears three-eyes turkey turtle tux udder vader
vader-koala www
[root@ansible ~]# cd /usr/share/cowsay[root@ansible cowsay]# ll总用量 204
-rw-r--r--. 1 root root  584 6月  25 2016 beavis.zen.cow
-rw-r--r--. 1 root root  639 6月  25 2016 blowfish.cow
-rw-r--r--. 1 root root  310 6月  25 2016 bud-frogs.cow
-rw-r--r--. 1 root root  123 6月  25 2016 bunny.cow
-rw-r--r--. 1 root root  480 6月  25 2016 cheese.cow
-rw-r--r--. 1 root root  230 6月  25 2016 cower.cow
-rw-r--r--. 1 root root  175 6月  25 2016 default.cow
-rw-r--r--. 1 root root 1284 6月  25 2016 dragon-and-cow.cow
-rw-r--r--. 1 root root 1527 6月  25 2016 DragonAndCow.pm
-rw-r--r--. 1 root root 1000 6月  25 2016 dragon.cow
-rw-r--r--. 1 root root  284 6月  25 2016 elephant.cow
-rw-r--r--. 1 root root  295 6月  25 2016 elephant-in-snake.cow
-rw-r--r--. 1 root root 3038 6月  25 2016 Example.pm
-rw-r--r--. 1 root root  585 6月  25 2016 eyes.cow
-rw-r--r--. 1 root root  490 6月  25 2016 flaming-sheep.cow
-rw-r--r--. 1 root root  712 6月  25 2016 Frogs.pm
-rw-r--r--. 1 root root 1018 6月  25 2016 ghostbusters.cow
-rw-r--r--. 1 root root  257 6月  25 2016 head-in.cow
-rw-r--r--. 1 root root  126 6月  25 2016 hellokitty.cow
-rw-r--r--. 1 root root  637 6月  25 2016 kiss.cow
-rw-r--r--. 1 root root  296 6月  25 2016 kitty.cow
-rw-r--r--. 1 root root  162 6月  25 2016 koala.cow
-rw-r--r--. 1 root root  406 6月  25 2016 kosh.cow
-rw-r--r--. 1 root root  225 6月  25 2016 luke-koala.cow
-rw-r--r--. 1 root root  941 5月  22 21:38 mech-and-cow.cow
-rw-r--r--. 1 root root 1183 6月  25 2016 MechAndCow.pm
-rw-r--r--. 1 root root  473 6月  25 2016 meow.cow
-rw-r--r--. 1 root root  439 6月  25 2016 milk.cow
-rw-r--r--. 1 root root  242 6月  25 2016 moofasa.cow
-rw-r--r--. 1 root root  203 6月  25 2016 moose.cow
-rw-r--r--. 1 root root  201 6月  25 2016 mutilated.cow
-rw-r--r--. 1 root root  252 6月  25 2016 ren.cow
-rw-r--r--. 1 root root  234 6月  25 2016 sheep.cow
-rw-r--r--. 1 root root  433 6月  25 2016 skeleton.cow
-rw-r--r--. 1 root root  194 6月  25 2016 small.cow
-rw-r--r--. 1 root root  854 6月  25 2016 stegosaurus.cow
-rw-r--r--. 1 root root 1193 6月  25 2016 Stegosaurus.pm
-rw-r--r--. 1 root root  364 6月  25 2016 stimpy.cow
-rw-r--r--. 1 root root  280 6月  25 2016 supermilker.cow
-rw-r--r--. 1 root root  892 6月  25 2016 surgery.cow
-rw-r--r--. 1 root root  333 6月  25 2016 telebears.cow
-rw-r--r--. 1 root root 3624 6月  25 2016 TextBalloon.pm
-rw-r--r--. 1 root root  293 6月  25 2016 three-eyes.cow
-rw-r--r--. 1 root root 1302 6月  25 2016 turkey.cow
-rw-r--r--. 1 root root 1105 6月  25 2016 turtle.cow
-rw-r--r--. 1 root root  215 6月  25 2016 tux.cow
-rw-r--r--. 1 root root 1134 6月  25 2016 TuxStab.pm
-rw-r--r--. 1 root root  392 6月  25 2016 udder.cow
-rw-r--r--. 1 root root  279 6月  25 2016 vader.cow
-rw-r--r--. 1 root root  213 6月  25 2016 vader-koala.cow
-rw-r--r--. 1 root root  248 6月  25 2016 www.cow

指定某个动物:

[root@ansible cowsay]# cowsay -f kitty hellow world!_______________

---------------
    \
     \
      ("`-'  '-/") .___..--' ' "`-._
        ` *_ *  )    `-.   (      ) .`-.__. `)
        (_Y_.) ' ._   )   `._` ;  `` -. .-'
     _.. `--'_..-_/   /--' _ .' ,4
  ( i l ),-''  ( l i),'  ( ( ! .-'
[root@ansible cowsay]#

安装fortune,csdn积分下载

[root@ansible ~]# ll总用量 1612
-rw-------. 1 root root    1187 7月   5 21:35 anaconda-ks.cfg
-rw-r--r--. 1 root root 1116792 7月  10 01:13 fortune-mod-1.99.1-17.sdl7.x86_64.rpm
-rwxr--r--. 1 root root     113 7月   5 23:56 key.sh
-rw-r--r--. 1 root root  522820 7月  10 01:19 librecode-3.6-alt11.1.1.x86_64.rpm
[root@ansible ~]# rpm -ivh librecode-3.6-alt11.1.1.x86_64.rpmVerifying...                          ################################# [100%]准备中...                          ################################# [100%]正在升级/安装...
  1:librecode-3.6-alt11.1.1          ################################# [100%][root@ansible ~]# rpm -ivh fortune-mod-1.99.1-17.sdl7.x86_64.rpm警告:fortune-mod-1.99.1-17.sdl7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID 41a40948: NOKEY
Verifying...                          ################################# [100%]准备中...                          ################################# [100%]正在升级/安装...
  1:fortune-mod-1.99.1-17.sdl7       ################################# [100%][root@ansible ~]# fortune | cowsay -f kiss_________________________________________
/ Let the worthy citizens of Chicago get  \
| their liquor the best way they can. I'm |
| sick of the job. It's a thankless one   |
| and full of grief.                      |
|                                         |
\ -- Al Capone                            /
-----------------------------------------
    \
     \
            ,;;;;;;;,
           ;;;;;;;;;;;,
          ;;;;;'_____;'          ;;;(/))))|((\
          _;;((((((|))))
         / |_\\\\\\\\\\\\
    .--~(  \ ~))))))))))))
   /     \  `\-(((((((((((\\
   |    | `\   ) |\       /|)
    |    |  `. _/  \_____/ |
     |    , `\~            /
      |    \  \           /
     | `.   `\|          /
     |   ~-   `\        /
      \____~._/~ -_,   (\
       |-----|\   \    ';;
      |      | :;;;'     \
     |  /    |            |
     |       |            |
[root@ansible ~]#

写了一个简单shell

[root@ansible ~]# cat cowsay.sh#!bin/bash# call cowsay after loginanimal=$(ls  /usr/share/cowsay | shuf -n 1)
str=${animal%.*}# pass sentence to cowsay with random animalfortune | cowsay -f $str[root@ansible ~]# sh cowsay.sh_______________________________________
/ The most important design issue... is \
| the fact that Linux is supposed to be |
| fun...                                |
|                                       |
| -- Linus Torvalds at the First Dutch  |
\ International Symposium on Linux      /
---------------------------------------
 \
  \   \_\_    _/_/
   \      \__/
          (oo)\_______
          (__)\       )\/\
              ||----w |
              ||     ||
[root@ansible ~]# sh cowsay.sh_______________________________________
/ Do your otters do the shimmy? Do they \
| like to shake their tails? Do your    |
| wombats sleep in tophats? Is your     |
\ garden full of snails?                /
---------------------------------------
  \
   \
     _____   _________
    /     \_/         |
   |                 ||
   |                 ||
  |    ###\  /###   | |  |     0  \/  0    | |
 /|                 | |
/ |        #

把sh放到/etc/profile.d 

Linux的cowsay命令怎么用

关于“Linux的cowsay命令怎么用”这篇文章的内容就介绍到这里,感谢各位的阅读!相信大家对“Linux的cowsay命令怎么用”知识都有一定的了解,大家如果还想学习更多知识,欢迎关注亿速云行业资讯频道。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI