Linux 终端上的漂亮小马
终端

> 
> 将小马宝莉的魔力带到终端
> 
> 
> 


![](/data/attachment/album/201901/29/201901zpa7pb7za4gpazug.png)


欢迎再次来到 Linux 命令行玩具日历。如果这是你第一次访问该系列，你甚至可能会问自己什么是命令行玩具。我们正在思考中，但一般来说，它可能是一个游戏，或任何简单的消遣，可以帮助你在终端玩得开心。


很可能你们中的一些人之前已经看过我们日历中的各种玩具，但我们希望每个人至少见到一件新事物。


读者 [Lori](https://opensource.com/users/n8chz) 在我之前关于 [cowsay](https://opensource.com/article/18/12/linux-toy-cowsay) 的文章的评论中提出了今天玩具的建议：


“嗯，我一直在玩一个叫 ponysay 的东西，它似乎是你的 cowsay 的彩色变种。”


我对此感到好奇，并去看了一下，发现没有让我失望。


简而言之，[ponysay](https://github.com/erkin/ponysay) 的 cowsay 的重写，它包括了来自[小马宝莉](https://en.wikipedia.org/wiki/My_Little_Pony)中的许多全彩色人物，你可以用它在 Linux 命令行输出短句。它实际上是一个非常完善的项目，拥有超过 400 个字符和字符组合，它还有让人难以置信的的 [78 页的 PDF 文档](https://github.com/erkin/ponysay/blob/master/ponysay.pdf?raw=true)涵盖了所有的用法。


要安装 `ponysay`，你需要查看项目的 [README](https://github.com/erkin/ponysay/blob/master/README.md) 来选择最适合你的发行版和情况的安装方法。由于 `ponysay` 似乎没有为我的 Fedora 发行版打包，我选择试用 Docker 容器镜像，但你可以选择最适合你的方法。从源码安装可能也适合你。


作为一个业余容器用户，我很想试试 [podman](https://opensource.com/article/18/10/podman-more-secure-way-run-containers) 来代替 docker。至少对于我而言，它可以正常工作。



```
$ podman run -ti --rm mpepping/ponysay 'Ponytastic'
```

输出很神奇，我建议你也试下，然后告诉我你最喜欢的。这是我其中一个：


![](/data/attachment/album/201901/29/201902lzg02mdr52cfvgmz.png)


它的开发人员选择用 [Pony](https://opensource.com/article/18/5/pony) 来编写代码。（更新：很遗憾我写错了。虽然 Gihutb 根据它的文件扩展名认为它是 Pony，但是它是用 Python 写的。）Ponysay 使用 GPLv3 许可，你可以在 [GitHub](https://github.com/erkin/ponysay) 中获取它的源码。


你有特别喜欢的命令行小玩具需要我介绍的吗？这个系列要介绍的小玩具大部分已经有了落实，但还预留了几个空位置。如果你有特别想了解的可以评论留言，我会查看的。如果还有空位置，我会考虑介绍它的。如果没有，但如果我得到了一些很好的意见，我会在最后做一些有价值的提及。


查看昨天的玩具，[在 Linux 终端中用火焰放松](https://opensource.com/article/18/12/linux-toy-aafire)，记得明天再来！




---


via: <https://opensource.com/article/18/12/linux-toy-ponysay>


作者：[Jason Baker](https://opensource.com/users/jason-baker) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


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


OK
Welcome to another day of the Linux command-line toys advent calendar. If this is your first visit to the series, you might be asking yourself what a command-line toy even is. We’re figuring that out as we go, but generally, it could be a game, or any simple diversion that helps you have fun at the terminal.

Some of you will have seen various selections from our calendar before, but we hope there’s at least one new thing for everyone.

Reader [Lori](https://opensource.com/users/n8chz) made the suggestion of today's toy in a comment on my previous article on [cowsay](https://opensource.com/article/18/12/linux-toy-cowsay):

*"Hmmm, I've been playing with something called **ponysay** which seems to be a full-color variant on your cowsay."*

Intrigued, I had to check it out, and I was not disappointed with what I found.

In a nutshell, ** ponysay** is exactly that: a rewrite of

**cowsay**that includes many full-color characters from

[My Little Pony](https://en.wikipedia.org/wiki/My_Little_Pony), that you can use to output phrases at the Linux command line. It's actually a really well-done project, that features over 400 characters and character combinations, and is incredibly well documented in a

[78-page PDF](https://github.com/erkin/ponysay/blob/master/ponysay.pdf?raw=true)covering full usage.

To install **ponysay**, you'll want to check out the project [README](https://github.com/erkin/ponysay/blob/master/README.md) to select the installation method that works best for your distribution and situation. Since ponysay didn't appear to be packaged for my distribution, Fedora, I opted to try out the Docker container image, but do what works best for you; installation from source may also work for you.

I was curious to try out [ podman](https://opensource.com/article/18/10/podman-more-secure-way-run-containers) as a drop-in replacement for

**docker**for a casual container users, and for me at least, it just worked!

`$ podman run -ti --rm mpepping/ponysay 'Ponytastic'`


The outputs are amazing, and I challenge you to try it out and let me know your favorite. Here was one of mine:

![Linux toy: ponysay output Linux toy: ponysay output](https://opensource.com/sites/default/files/uploads/linux-toy-ponysay-output.png)

~~It's~~~~ developers chose to write the code in ~~ [Pony](https://opensource.com/article/18/5/pony)!*(Update: Sadly, I was wrong about this. It's written in Python, though GitHub believes it to be Pony because of the file extensions.)* Ponysay is licensed under the GPL version 3, and you can pick up its source code [on GitHub](https://github.com/erkin/ponysay).

Do you have a favorite command-line toy that you think I ought to profile? The calendar for this series is mostly filled out but I've got a few spots left. Let me know in the comments below, and I'll check it out. If there's space, I'll try to include it. If not, but I get some good submissions, I'll do a round-up of honorable mentions at the end.

Check out yesterday's toy, [Relax by the fire at your Linux terminal](https://opensource.com/article/18/12/linux-toy-aafire), and check back tomorrow for another!

## 5 Comments