作为程序猿的你,几个绝对不能错过的Linux 有趣指令

No.1 sl

相信ls命令每个人都用过,可是如果不小心在linux的命令行中输入sl会有什么效果呢 ?
当然可能是这个效果,那我们安装一下试试吧。

mgm@ubuntu:~$ sl
The program 'sl' is currently not installed. You can install it by typing:
sudo apt install sl

嗯? 提示错误

mgm@ubuntu:~$ sudo apt-get install sl
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

这种情况是因为apt在运行,查看一下情况吧

mgm@ubuntu:~$ ps afx|grep apt
  677 ?        Ss     0:00 /bin/sh /usr/lib/apt/apt.systemd.daily
 2362 pts/0    S+     0:00                  \_ grep --color=auto apt
 2118 ?        SNl    0:00 /usr/bin/python3 /usr/sbin/aptd

kill them

mgm@ubuntu:~$ sudo kill -9 677
mgm@ubuntu:~$ sudo kill -9 2362
mgm@ubuntu:~$ sudo kill -9 2118

然后继续下载安装吧
安装后,输入sl,Oh yeah ~ 一辆蒸汽机车呼啸而过
在这里插入图片描述

No.2 Star Wars

相信大家可能很久都没看过电影了吧?ASCII 码版本的电影估计你更没看过,在线免费ASCII码版本的星球大战,一起来欣赏吧。
互联网刚开始兴起时,telnet 版本的BBS论坛是相当流行的,今天我们就去体验一盘。

mgm@ubuntu:~$ telnet towel.blinkenlights.nl

稍等片刻,字母过后,精彩继续。
切记,推出是“Ctrl+]”,然后在telnet 提示符下输 quit
在这里插入图片描述
在这里插入图片描述

No.3 Cowsay

会说话的牛!

我们先进入root用户模式吧

sudo passwd root

然后连续两次输入root的密码

mgm@ubuntu:~$ sudo su
root@ubuntu:/home/mgm#
root@ubuntu:/home/mgm# apt-get install cowsay

root@tecmint:~# cowsay I Love Linux

在这里插入图片描述
很多动物都可以开口说话哦,看看都有谁吧

root@ubuntu:/home/mgm# cowsay -l
Cow files in /usr/share/cowsay/cows:
apt beavis.zen bong bud-frogs bunny calvin cheese cock cower daemon default
dragon dragon-and-cow duck elephant elephant-in-snake eyes flaming-sheep
ghostbusters gnu head-in hellokitty kiss kitty koala kosh luke-koala
mech-and-cow meow milk moofasa moose mutilated pony pony-smaller ren sheep
skeleton snowman sodomized-sheep stegosaurus stimpy suse three-eyes turkey
turtle tux unipony unipony-smaller vader vader-koala www

当然我们还可以加上渐变效果。
后面带上lolcat参数

root@ubuntu:/home/mgm# cowsay -f turtle "haha" | lolcat
The program 'lolcat' is currently not installed. You can install it by typing:
apt install lolcat

提示lolcat没有安装,那就安装吧

root@ubuntu:/home/mgm# apt install lolcat

然后是这个效果
在这里插入图片描述
可以应用到很多领域哦,比如输入ls指令,让你的工作来点乐趣吧。
在这里插入图片描述

root@ubuntu:cal | lolcat

在这里插入图片描述

No.4 Cmatrix

想试一下黑客帝国里的效果的吗 ?

root@ubuntu:/home/mgm# apt-get install cmatrix

下载后执行

root@ubuntu:/home/mgm# cmatrix

在这里插入图片描述
退出按Ctrl+C

No.5 Oneko

来个小精灵陪伴你吧

root@tecmint:~# apt-get install oneko

下载后执行
root@tecmint:~# oneko
在这里插入图片描述
退出Ctrl+C

No.6 Fortune

敲代码之余,时不时会考一下人生?来几碗鸡汤吧

apt-get install fortune

root@ubuntu:/home/mgm# fortune
You are only young once, but you can stay immature indefinitely.

带点效果
在这里插入图片描述

No.7 figlet

一种字体看腻了 ? 来个大的吧!

root@ubuntu:/home/mgm# apt-get install figlet

在这里插入图片描述
除了figlet,还有个toilet
在这里插入图片描述

No.8 wttr.in

想及时了解一下天气预报吗 ?

root@ubuntu:/home/mgm# curl wttr.in

在这里插入图片描述
当然,可以看一下首都北京的天气

root@ubuntu:/home/mgm# curl wttr.in/beijing

No.9 linuxlogo

root@ubuntu:/home/mgm/gtop# sudo apt install linuxlogo

安装后直接执行

root@ubuntu:/home/mgm/gtop# linux_logo

可以查看系统支持的logo个数

root@ubuntu:/home/mgm/gtop# linux_logo -f -L list

然后指定显示某一个

root@ubuntu:/home/mgm/gtop# linux_logo -f -L 4

或者来个循环显示

root@ubuntu:/home/mgm/gtop# for i in {
    
    1..30};do linux_logo -f -L $i;sleep 2;done

No.10 Asciiquarium

试了这么多累了吧,喂喂鱼休息一下吧。

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

如果这个方法在第二步的时候提示出错,那就换下面的试试

root@ubuntu:/tmp# apt-get install asciiquarium

然后执行

root@ubuntu:/tmp# asciiquarium

nice!
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/malcolm_110/article/details/107078373