12 个有趣的 Linux 终端命令
命令 有趣

> 
> 你觉得 Linux 终端里只有无趣的工作吗？那你一定不知道下面这些有趣的 Linux 命令吧。
> 
> 
> 


Linux 终端是用来完成复杂的工作的，我们有很多有用的 [linux 命令奇技淫巧](https://itsfoss.com/linux-command-tricks/)来帮助你。


但是，你知道你还可以用终端来做很多有趣的事吗？如果你不知道，没关系，大多数 Linux 用户也都只把终端视为一个用来管理系统和开发工作的交互界面。


然而，如果你知道这里有些你可以在终端玩的[基于终端的游戏](https://itsfoss.com/best-command-line-games-linux/)和 [ASCII 码游戏](https://itsfoss.com/best-ascii-games/)，你一定会大吃一惊。


在这篇文章中，我将会探索一些有趣的、可笑的、荒谬的命令来让你可以在终端中找点乐子！


### 用这些命令在 Linux 终端中找点乐子


![](/data/attachment/album/202004/25/173540f111i1i7jtqijtn1.png)


你可能会觉得这些命令荒谬或没用，但是有一些还是可以被好好利用的。


我已经放上了 Ubuntu/Debian 的安装指令，如果你使用基于 Ubuntu 的发行版，请确保[启用 universe 仓库](https://itsfoss.com/ubuntu-repositories/)，因为大多数命令不在主仓库中。


如果你使用 Arch、Fedora、SUSE、Solus 或者其他非 Ubuntu 的发行版，请使用你的发行版包管理工具去安装这些有趣的 Linux 命令。


#### 1、在终端开一辆火车


让我们坐上火车，来一场说走就走的旅行的，没错，就是字面意思！


`sl` 命令可以让你在终端运行一辆火车。


![](/data/attachment/album/202004/25/173348yx81qv1481w68i4f.jpg)


安装方法：



```
sudo apt install sl
```

完成后，你只要在终端输入下面的命令就可以开始：



```
sl
```

很精彩，对吧？但等等，我们还没结束！你还可以让你的火车飞起来，只要加上参数 `-F`，波特先生，请飞吧：



```
sl -F
```

这样会让火车长出翅膀飞出终端窗口！


#### 2、给你的 Linux 终端加上黑客帝国效果


还记得科幻电影[黑客帝国](https://en.wikipedia.org/wiki/The_Matrix)吗？终端里掉落的绿色字符成为了黑客帝国的标志形象。


你也可以在你的 Linux 电脑里有这样的黑客帝国数字雨！你只需要安装 `cmatric` 然后在终端输入它就行。


![](/data/attachment/album/202004/25/173350c7d7mw13g310cgc0.png)


在 Debian/Ubuntu Linux 上安装 cmatrix:



```
sudo apt install cmatrix
```

现在，你要做的就是输入下面的命令，在终端就会有黑客帝国屏幕了：



```
cmatrix
```

按下 `Ctrl+C` 来停止它，黑客先生。


#### 3、燃起来


拿好灭火器，因为接下来你要在你的终端里点火了！


![](/data/attachment/album/202004/25/173355q7kypp1znnwrvrri.png)


想安装它，你要输入：



```
sudo apt install libaa-bin
```

完成后，你输入下面的命令，你的终端就会燃起一团火焰：



```
aafire
```

按下 `Ctrl+C` 来停止它。


#### 4、幸运饼干命令


想知道你的运气怎样但身边没有幸运饼干？


别担心，你只需在终端打出 `fortune` 然后按下回车。终端将会随机显示出一个幸运语，就像你从幸运饼干里得到的一样。


![](/data/attachment/album/202004/25/173356si7kd297uy1uu1c7.jpg)


安装它：



```
sudo apt install fortune
```

完成后，只要在命令行打出下面的内容，你就会知道你的运气怎样：



```
fortune
```

这是一个你可以实际使用的命令。你可以用它作为每日消息，这样在多用户环境下，每个用户登录后都会得到一个“幸运饼干”。


你也可以把它添加到 `bashrc` 文件，这样当你登进终端你就会看到了。


#### 5、宠物爱好者？这是给你准备的


`oneko` 是一个有趣的命令，可以把你的光标变成一只老鼠，然后创造一只好奇的猫，一旦你移动光标，就会来追你。这不仅局限于终端。当猫追逐光标时，你可以继续工作。


如果你家里有孩子这一定很有趣。


![](/data/attachment/album/202004/25/173650l2tczstuvov6zveg.jpg)


用下面的命令安装 `oneko`：



```
sudo apt install oneko
```

用下面的命令运行它：



```
oneko
```

如果你不喜欢猫，喜欢狗，输入：



```
oneko -dog
```

它有很多种小宠物，你可以用 `oneko -help` 获取信息。按下 `Ctrl+C` 终止它。


#### 6、有个小兄弟在看着你


`xeyes` 是一个很小的 GUI 程序，它可以绘制出一双眼睛一直盯着你！它会不断跟随你的鼠标光标，运行命令自己看看！


![](/data/attachment/album/202004/25/173402xf8exxjx1kkuukuk.jpg)


你可以用下面命令安装：



```
sudo apt install xeyes
```

然后这样用它：



```
xeyes
```

按下 `Ctrl+C` 终止它。


#### 7、让终端帮你讲话


打开你的扬声器，你来试试这个命令，[eSpeak](https://itsfoss.com/espeak-text-speech-linux/) 是一个有趣的命令，它可以让你的终端说话。是的，你没听错。


先安装这个包：



```
sudo apt install espeak
```

接下来，你只需要输入在命令行中输入你想听到的话：



```
espeak "Type what your computer says"
```

无论你在双引号里面填什么，你的电脑都会复述出来！它就像[在 Linux 中的 echo 命令](https://linuxhandbook.com/echo-command/)，但不是打印出来，而是说出来。


#### 8、Toilet（但与洗手间无关）


这听起来有点奇怪，是的。但是，这只是一个命令，用来将文本转换成大的 ASCII 字符。


![](/data/attachment/album/202004/25/173447dhfre4rwehroft5p.jpg)


用这个命令安装 `toilet`：



```
sudo apt install toilet
```

完成后，你只需输入：



```
toilet sample text you want
```

我也不知道为啥这个小程序叫 Toilet。


#### 9、那个牛说什么？


`cowsay` 是一个在终端中用 ASCII 字符展示出一头牛的命令。通过这个命令，你可以控制牛说出你想说的话。


别纠结声音，它只展示文本（就是你看漫画书一样）。


![Cowsay Cowthink](/data/attachment/album/202004/25/173453pbfvuu8te7ttqbvm.jpg)


安装 `cowsay`：



```
sudo apt install cowsay
```

安装完成后，你只要输入：



```
cowsay "your text"
```

无论你在双引号里填什么，你的牛都会说！我看到一些系统管理员用它来展示每天的消息。你也可以这样，你甚至可以把它和 `fortune` 命令结合。


#### 10、旗帜


`banner` 命令与 `toilet` 命令相似，但它限制最多只能打印 10 个字符。


![](/data/attachment/album/202004/25/173457fywe4ot9ne7yy77w.jpg)


你可以这样安装 `banner` 命令：



```
sudo apt install sysvbanner
```

然后这样运行：



```
banner "Welcome"
```

替换双引号里的内容，你将会得到你想要的展示内容。


#### 11、Yes


![](/data/attachment/album/202004/25/173458lp2v6jtk8iripc2k.jpg)


`yes` 命令帮助你在循环中自动响应直到终止命令。这个命令将会一直打印相同的内容。如果你想快速生成大量垃圾文本，那么此命令将像超级按钮一样工作。


你也可以使用它为命令提供 `yes` 应答（如果提示应答时）。例如，`apt upgrade` 命令会要求你确认，你可以像这样使用它：



```
yes | sudo apt upgrade
```

你不需要安装任何包，`yes` 命令已经存在了。


想要终止 `yes` 命令循环，只需按下 `CTRL+C`。


#### 12、得到一个新的身份


要生成一个随机的假身份吗？我推荐你用 `rig` 命令。你在终端运行它，就会生成一个假的身份。


![](/data/attachment/album/202004/25/173500uitrqodidsdby9mo.jpg)


用这个命令安装 `rig`：



```
sudo apt install rig
```

只需像这样输入：



```
rig
```

它可能被用在脚本或者 web 应用中展示随机信息，但我自己还没做过什么。


### 结尾


我希望你会喜欢这个有趣的 Linux 命令列表。你最喜欢哪个命令呢？你还知道其他有趣的命令吗？请在评论部分与我们分享。




---


via: <https://itsfoss.com/funny-linux-commands/>


作者：[Srimanta Koley](https://itsfoss.com/author/itsfoss/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[Zioyi](https://github.com/Zioyi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
![Warp Terminal](/assets/images/warp-terminal.webp)


![Warp Terminal](/assets/images/warp-terminal.webp)

The Linux terminal is the place to get serious work done. We have plenty of useful [Linux command tips and tricks](https://itsfoss.com/linux-command-tricks/) to help you with that.

But, did you know that you can have a lot of fun using the terminal? Well, if you did not, then you are not alone. Most Linux users see the terminal as an interface that is designed and built for system management and development tasks.

However, you will be surprised to know that there are tons of [terminal based games](https://itsfoss.com/best-command-line-games-linux/) and [ASCII games](https://itsfoss.com/best-ascii-games/) that you can play in the terminal.

And, in this article, I’m going to explore some interesting, some funny and some ridiculous commands that you can type into the terminal on Linux and have fun!

[enable universe repository](https://itsfoss.com/ubuntu-repositories/)as most of these commands are not in the main repository. For other distros, please use your respective package managers.

## 1. sl*: *Run a train in your terminal

*:*

Let’s take a ride in the locomotive and begin our auspicious journey. And I mean it literally!

The `sl`

command allows you to [run a train in your terminal](https://itsfoss.com/ubuntu-terminal-train/).

![Use "sl" or Steam Locomotive command to get a running train inside your terminal](https://itsfoss.com/content/images/2023/10/sl-command.gif)

`sl`

commandHere’s how to install the command:

` sudo apt install sl`


Once done, you can simply type in the following in the terminal to get started:

`sl`


Impressive, isn’t it? But, hold on. We are not done yet! Apparently, you can fly your locomotive. Just add the option -F, Mr. Potter:

`sl -F`


![Use "sl" command with "-F" option to get a flying train](https://itsfoss.com/content/images/2023/10/sl-fly.gif)

This should make the locomotive get wings to fly off from the terminal window!

[Running a Train in the Linux Terminal With sl CommandChoo choo! All aboard the choo choo train in the Linux terminal.](https://itsfoss.com/ubuntu-terminal-train/)![](https://itsfoss.com/content/images/wordpress/2015/04/Linux_Terminal_Train.jpeg)


![](https://itsfoss.com/content/images/wordpress/2015/04/Linux_Terminal_Train.jpeg)

## 2. cmatrix*: *Add the Matrix effect to your Linux terminal

*:*

Remember the iconic sci-fi movie [The Matrix](https://en.wikipedia.org/wiki/The_Matrix?ref=itsfoss.com)? The green text falling down on the terminal became an identity of Matrix.

You can have this Matrix digital rain on your Linux boxes as well! You just need to [install cmatrix](https://itsfoss.com/using-cmatrix/) and type it in the terminal.

![Get a Matrix Screen using "cmatrix" Command](https://itsfoss.com/content/images/2023/10/cmatrix.gif)

`cmatrix`

commandInstalling cmatrix on Debian/Ubuntu Linux:

`sudo apt install cmatrix`


Now, all you have to do is type the following to get the matrix screen on the terminal:

`cmatrix`


**Press Ctrl+C to stop it, Mr. Anderson.**

## 3. aafire*: *Let there be fire

*:*

Keep your fire extinguisher handy because now you are going to start a fire in your terminal!

![Get an ASCII Fire using the "aafire" Command](https://itsfoss.com/content/images/2023/10/aafire.gif)

To get it installed, here’s what you have to type:

`sudo apt install libaa-bin`


Once done, start a fire in your terminal by entering:

`aafire`


Press Ctrl+C to stop it.

## 4. fortune*: *Want to know your fortune, but there are no fortune cookies around you?

*:*

Not to worry, you just need to type “fortune” on your terminal and press enter. The terminal will display a random sentence, just like you usually get in fortune cookies.

`fortune`

commandInstall it with:

`sudo apt install fortune`


Once done, simply type in the command below to know your fortune:

`fortune`


Now, this is one of the commands here that you could actually use. You can use it as message of the day so that in a multi-user environment, all the users will see a random fortune cookie when they log in.

## 5. oneko*: *Pet lover? This is for you

*:*

Oneko is a little fun command that will change your regular cursor into a mouse and creates a curious little cat who will chase your cursor once you move it. It’s not limited to just the terminal. You can keep on working while the cat chases the cursor.

Now, that’s something fun to do, specially if you have kids at home.

![Change your regular cursor into a mouse and see a curious little cat chasing your cursor once you move it, using Oneko](https://itsfoss.com/content/images/2023/10/oneko.gif)

Install Oneko with this command:

`sudo apt install oneko`


Run it with this command:

`oneko`


In case you want a dog instead of a cat, type:

`oneko -dog`


![Get a dg instead of cat using "-dog" option with "oneko" command](https://itsfoss.com/content/images/2023/10/oneko-dog.gif)

There are a few more types of cats available. You can get that information by using oneko –help. To stop it, use Ctrl+C.

## 6. xeyes*: *Little brother is watching you

*:*

Xeyes is a tiny GUI program that let the user draws a pair of ever watching eyes! It will follow your mouse cursor constantly. Run the command and see it yourself!

![Use Xeyes Command to draw a pair of ever watching eyes! It will follow your mouse cursor constantly.](https://itsfoss.com/content/images/2023/10/xeyes.gif)

This command is provided by `x11-apps`

package. You can install it using this command:

`sudo apt install x11-apps`


And then use it with this:

`xeyes`


Press Ctrl+C to stop it.

## 7. espeak*: *Let the terminal speak for you

*:*

To try out this command, make sure you have turned on your speakers. [eSpeak](https://itsfoss.com/espeak-text-speech-linux/) is a fun command that gives your terminal a voice. Yes, you heard that right.

Install the package first:

`sudo apt install espeak`


Next, you need to simply type in the command along with a text that you want to listen as audio:

`espeak "Type what your computer says"`


Whatever you place in the double quotes, your computer is obligated to say! It’s like [echo command in Linux](https://linuxhandbook.com/echo-command/?ref=itsfoss.com). But instead of printing, it speaks.

## 8. Toilet*: *But it has nothing to do with a washroom

*:*

This sounds weird, yes. But, it’s just a command that transforms a text into large ASCII characters.

Install toilet with this command:

`sudo apt install toilet`


Once done, you just need to type in:

`toilet "sample text you want"`


I don’t know why this little program is called toilet.

## 9. cowsay*: *What does the ~~fox~~ cow say?

*:*

[Cowsay is a command](https://itsfoss.com/cowsay/) that displays a cow using ASCII characters in the terminal. And by using this command, you can instruct the cow to say anything you want.

Not to be confused with any audio – it will just display a text (like you usually see in a comic book).

Install** **cowsay:

`sudo apt install cowsay`


Once you have it installed, you just need to type in:

`cowsay "your text"`


Whatever you place in the double quotes, your cow is obligated to say! I have seen a few sysadmins using it to display the message of the day. Maybe you can do the same. You may even combine it with fortune command.

[Using Cowsay Linux Command Like a ProThe cowsay is a fun little Linux command line utility that can be enjoyed in so many ways. Here are several examples.](https://itsfoss.com/cowsay/)![](https://itsfoss.com/content/images/2023/06/cowsay-linux-1.png)


![](https://itsfoss.com/content/images/2023/06/cowsay-linux-1.png)

## 10. banner*: *Whose banner is it?

*:*

The banner command works just like the toilet command, but it is limited to print only 10 characters at most.

You can install banner command like this:

`sudo apt install sysvbanner`


Then use it in the following way:

`banner "Welcome"`


Replace content in the double quotes and you shall have your desired text displayed.

## 11. Yes*: *Yes, Terminal!

*:*

The “yes” command helps you to loop an automated response until you terminate the command. This command will print the exact same thing indefinitely. If you want to produce huge amounts of junk text fast, then this command will work like a charm.

![Use "Yes" command to loop an automated response until you terminate the command](https://itsfoss.com/content/images/2023/10/yes-Command.gif)

You may also use it to provide a yes to a command (if it prompts for it). For example, the apt upgrade command asks for your confirmation, you can use it like this:

`yes | sudo apt upgrade`


You don’t need to install any package for it. Yes command is already available.

To terminate the yes command loop, simply press **CTRL + C**.

## 12. rig*: *Get a new identity, well, sort of

*:*

Want to generate a random fake identity? I give you the command “rig”. Once you place this in the terminal, it will generate a fake identity.

Install rig with this command:

`sudo apt install rig`


Then simply type this:

`rig`


It may be used in scripts or web-apps that displays random information, but I haven’t done anything of that sort on my own.

## 13: Asciiquarium (An aquarium for your terminal!)

Asciiquarium can generate a beautiful colored aquarium right inside your terminal.

![Asciiquarium command and get a colorful aquarium inside your terminal](https://itsfoss.com/content/images/2023/10/asciiquarium.gif)

On Fedora and Arch Linux based system, you can install Asciiquarium through respective package managers.

```
sudo dnf install asciiquarium
OR
sudo pacman -Syu asciiquarium
```


On Ubuntu, you can [download the source package and make yourself](https://robobunny.com/projects/asciiquarium/html/). Or use a PPA:

```
sudo add-apt-repository ppa:ytvwld/asciiquarium
sudo apt update
sudo apt install asciiquarium
```


[PPA in Ubuntu Linux [Definitive Guide]An in-depth article that covers almost all the questions around using PPA in Ubuntu and other Linux distributions.](https://itsfoss.com/ppa-guide/)![](https://itsfoss.com/content/images/2023/05/Understanding-ppa-in-ubuntu.png)


![](https://itsfoss.com/content/images/2023/05/Understanding-ppa-in-ubuntu.png)

Now, simply run:

`asciiquarium`


**There are more fun stuff in the terminal**

You’ll find a lot of these commands ridiculous or useless, but banner and some other commands could actually be put to some good use.

Want to experiment more with the terminal? How about a vintage one?

[Get a Vintage Linux Terminal with Cool Retro TerminalGetting nostalgic about the old CRT monitors of the 80s? You can relive it in Linux with the Cool Retro Term application.](https://itsfoss.com/cool-retro-term/)![](https://itsfoss.com/content/images/wordpress/2015/10/Retro-Terminal-Linux.jpeg)


![](https://itsfoss.com/content/images/wordpress/2015/10/Retro-Terminal-Linux.jpeg)

Or, displaying your distribution's logo in ASCII format.

[Display Linux Distribution Logo in ASCII Art in TerminalWondering how they display Linux logo in terminal? With these tools, you can display logo of your Linux distribution in ASCII art in the Linux terminal.](https://itsfoss.com/display-linux-logo-in-ascii/)![](https://itsfoss.com/content/images/wordpress/2015/10/display-linux-logo-ascii-terminal.jpeg)


![](https://itsfoss.com/content/images/wordpress/2015/10/display-linux-logo-ascii-terminal.jpeg)

If you liked that, [have more fun with ASCII art in the terminal](https://itsfoss.com/ascii-art-linux-terminal/).

[10 Tools to Have Fun With ASCII Art in Linux TerminalThink Linux terminal is all about serious work? Think again. Here are a few fun things you can do with ASCII art in the terminal.](https://itsfoss.com/ascii-art-linux-terminal/)![](https://itsfoss.com/content/images/wordpress/2022/07/ascii-art-tools-linux.png)


![](https://itsfoss.com/content/images/wordpress/2022/07/ascii-art-tools-linux.png)

I hope you liked this list of fun Linux commands. Which command do you like the most here? Do you know some other such amusing commands? Do share it with us in the comment section.

[let us know](https://itsfoss.com/contact-us/).