mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-23 21:20:42 +08:00
Merge pull request #30123 from LCTT/revert-30121-Translation-20220706-ASCII-Art-Tools
Revert "[完成翻译] 20220706 10 Tools to Generate and Have Fun With ASCII Art in L…"
This commit is contained in:
commit
83fa94dba2
@ -2,239 +2,240 @@
|
||||
[#]: via: "https://itsfoss.com/ascii-art-linux-terminal/"
|
||||
[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/"
|
||||
[#]: collector: "lkxed"
|
||||
[#]: translator: " "
|
||||
[#]: translator: "泠知落汐"
|
||||
[#]: reviewer: " "
|
||||
[#]: publisher: " "
|
||||
[#]: url: " "
|
||||
|
||||
10 个在 Linux 终端中生成有趣的 ASCII 字符画的工具
|
||||
10 Tools to Generate and Have Fun With ASCII Art in Linux Terminal
|
||||
======
|
||||
Linux 终端其实没有想象中的那样可怕。
|
||||
Linux terminal is not as scary as you think.
|
||||
|
||||
当然啦,一开始它可能会令人望而却步,但是当我们更了解它的时候,我们就会喜欢上它的。
|
||||
Of course, it could be intimidating in the beginning but once you [know the terminal better][1], you start loving it.
|
||||
|
||||
你可能会使用终端来做一些严肃的工作。不过,你也可以在终端中做很多有趣的事情。
|
||||
You are likely to use the terminal for serious work. But there are many fun stuff you can do in the terminal as well.
|
||||
|
||||
其中的一项就是试一试 ASCII 字符画。你可以在 Linux 终端中用各种命令行工具以 ASCII 的形式显示一些预定义的或是随机的消息,玩游戏,抑或是播放动画。
|
||||
One of them is experimenting with ASCII art. You can display predefined or random messages, play games, or run some animation in ASCII format in the Linux terminal using various command line tools.
|
||||
|
||||
我的队友 Sreenath 喜欢探索此类不寻常的命令行工具并将他的发现分享给我。现在,我也将他的发现与你分享。
|
||||
My teammate Sreenath likes to explore such unusual CLI tools and share his findings with me. I am sharing those findings with you.
|
||||
|
||||
![ascii art tools linux][2]
|
||||
|
||||
Most of these programs should be available in the repositories of your Linux distribution. You can use your system’s package manager to install them. To keep the article concise, I have only included the installation instructions for Ubuntu.
|
||||
|
||||
你的 Linux 发行版的仓库中应该已经有这些程序中的大多数了。你可以用系统的包管理器安装它们。为了使文章简洁,下文的安装指南均以 Ubuntu 为例。
|
||||
### 1. lolcat: 向终端加入缤纷色彩
|
||||
### 1. lolcat: Add colors to your terminal
|
||||
|
||||
虽然 lolcat 与 ASCII 字符画没有任何关系,至少,没有直接关系。
|
||||
Alright! lolcat doesn’t have anything to do with ASCII art. At least not directly.
|
||||
|
||||
但是,我还是在文章开头就列出了它,因为它可以与其他的 ASCII 工具组合使用。
|
||||
Still, I included it at the beginning of this article because you can combine other ASCII tools with lolcat.
|
||||
|
||||
所以,它能做什么呢?它与 cat 指令很相似,但是它向输出内容加入随机的渐变色彩。
|
||||
So, what does it do? It is similar to the cat command but it adds random gradient colors to its output.
|
||||
|
||||
![lolcat][3]
|
||||
|
||||
目前它看起来可能没什么用,但当其他 ASCII 工具通过 lolcat 输出时,您会看到它的效果。
|
||||
It may not look useful at the moment but you’ll see its impact when the outputs of other ASCII tools are piped through lolcat.
|
||||
|
||||
用 apt 安装 lolcat:
|
||||
Install lolcat with the apt command:
|
||||
|
||||
```
|
||||
sudo apt install lolcat
|
||||
```
|
||||
### 2. Aewan: 漂亮地显示 ASCII 字符
|
||||
|
||||
Aewan 是一个多层 ASCII 图形、动画编辑器。它可以生成独立的,可被 cat 命令查看的 ASCII 字符画文件和便于命令行工具集成与解析的格式。
|
||||
### 2. Aewan: Display ASCII text beautifully
|
||||
|
||||
它包括两个工具:ASCII 编辑器 `aewan`,和文件查看器 `aecat`。
|
||||
Aewan is a multi-layered ASCII graphics/animation editor. It produces stand-alone cat-able ASCII art files and an easy-to-parse format for integration into terminal applications.
|
||||
|
||||
这里不讨论编辑器部分。
|
||||
It has two tools: `aewan`, an ASCII editor and `aecat`, for viewing the created file.
|
||||
|
||||
![aewan 的初始状态布局][4]
|
||||
I am not going to discuss the editor part here.
|
||||
|
||||
用 aecat 命令以 ASCII 格式漂亮地显示任何文本。注意下面的截屏中字母的使用方式。
|
||||
![aewan initial layout][4]
|
||||
|
||||
To display any text in pretty ASCII format, you need the aecat command. Notice the use of letters in the screenshot below.
|
||||
|
||||
![aewan output][5]
|
||||
|
||||
用下面的命令安装 aewan:
|
||||
To install aewan use the following command:
|
||||
|
||||
```
|
||||
sudo apt install aewan
|
||||
```
|
||||
|
||||
然后这样使用:
|
||||
And then use it like this:
|
||||
|
||||
```
|
||||
aecat hello
|
||||
```
|
||||
|
||||
### 3. Cowsay: 让 ASCII 牛复述你想说的话
|
||||
### 3. Cowsay: Make an ASCII cow say whatever you want
|
||||
|
||||
牛说什么?你想什么就让它说什么。
|
||||
What does the cow say? Whatever you want it to say.
|
||||
|
||||
cowsay 是已经在经验丰富的 Linux 用户中流行的工具。它显示了一个 ASCII 牛,会重复你提供的文本。
|
||||
The cowsay is already a popular tool among seasoned Linux users. It shows an ASCII cow that repeats the text you provide it.
|
||||
|
||||
![cowsay][6]
|
||||
|
||||
但不仅限于牛。你也可以将其更改为其他的角色。比如,一条龙(火龙君临):
|
||||
But you are not restricted to cows only. You can change it to several other characters as well. Like a dragon (burning King’s landing):
|
||||
|
||||
![cowsay][7]
|
||||
|
||||
你注意到截图中的色彩了吗?这正是上文提到过的 lolcat 命令的魔力所在。
|
||||
Did you notice the colored output in the above screenshot? That’s the magic of the lolcat command I mentioned earlier.
|
||||
|
||||
用下列命令安装 cowsay:
|
||||
To install cowsay, use:
|
||||
|
||||
```
|
||||
sudo apt install cowsay
|
||||
```
|
||||
|
||||
装好之后,这样使用:
|
||||
Once installed, you can use it like this:
|
||||
|
||||
```
|
||||
cowsay hello
|
||||
```
|
||||
|
||||
你可以参考它的 [手册][8],浏览其他配置和选项。
|
||||
You can refer to its [man page][8] for additional configuration and options.
|
||||
|
||||
### 4. jp2a: 图片转 ASCII 字符画
|
||||
### 4. jp2a: Convert images into ASCII art
|
||||
|
||||
jp2a 是一个在 Linux 终端中将图像转换为 ASCII 字符画的命令行工具。它适用于 JPEG 和 PNG 文件,允许彩色输出和用您选定的字符显示 ASCII 字符画。
|
||||
jp2a is a command-line tool that [converts images to ASCII art in the Linux terminal][9]. It works with JPEG and PNG files. It also allows colored output and your selection of character set to appear as ASCII image.
|
||||
|
||||
![jp2a][10]
|
||||
|
||||
用下列命令安装它:
|
||||
You can install it using the following command:
|
||||
|
||||
```
|
||||
sudo apt install jp2a
|
||||
```
|
||||
|
||||
你可以像这样得到彩色的输出,并且保存到文件。
|
||||
You can get the colorful output and save the ASCII text like this:
|
||||
|
||||
```
|
||||
jp2a --output=ascii.txt --colors input.png
|
||||
```
|
||||
|
||||
它并不是这类工具中的唯一一种,比如,ascii-image-converter 和几个其他的工具也可以达成相同的效果。在这里不再一一讨论了。
|
||||
It’s not the only program of this kind. There is ascii-image-converter and several other tools that could be used for the same purpose. I won’t discuss all of them in this list.
|
||||
|
||||
### 5. linuxlogo: 用 ASCII 格式显示 Linux 发行版的徽标
|
||||
### 5. linuxlogo: Display the ASCII logo your Linux distro
|
||||
|
||||
正如起名,它[用 ASCII 格式显示 Linux 发行版的标志][11]。
|
||||
The name says it all. It displays the [Linux logo in ASCII format][11].
|
||||
|
||||
不,不是我们[喜爱的 Linux 标志 Tux][12],而是您的 Linux 发行版的徽标。它还显示一些其他信息,比如 Linux 内核版本、CPU、RAM、主机名等等。
|
||||
No, not our [beloved Linux logo, Tux][12] but the logo of your Linux distribution. It also shows a few additional information like [Linux kernel version][13], CPU, RAM, hostname, etc.
|
||||
|
||||
![linux logo][14]
|
||||
|
||||
用 apt 安装:
|
||||
You can install it using the apt command:
|
||||
|
||||
```
|
||||
sudo apt install linuxlogo
|
||||
```
|
||||
|
||||
输入 linuxlogo 就可以用啦。
|
||||
Just enter linuxlogo to use the command.
|
||||
|
||||
### 6. Neoftech: 显示 Linux 标志和系统信息
|
||||
### 6. Neoftech: Display the Linux logo along with system info
|
||||
|
||||
上面的 Linux 标志有点太简化了。你可以用 Neofetch 放大他。
|
||||
The above linuxlogo command is too simplistic. You can amp it up by using Neofetch.
|
||||
|
||||
它以更漂亮的方式显示发行版以及一些系统信息,如内核、运行时间、桌面环境、主题和图标等等。
|
||||
It displays the distribution in a more pretty way along with several system information like kernel, uptime, desktop environment, theme, icons, etc.
|
||||
|
||||
![neofetch][15]
|
||||
|
||||
您还可以通过 lolcat 解析它,获得彩虹色的输出。
|
||||
You can also parse it through lolcat to get rainbow-colored output.
|
||||
|
||||
用这行命令安装 Neofetch:
|
||||
Install Neoftech using this command:
|
||||
|
||||
```
|
||||
sudo apt install neofetch
|
||||
```
|
||||
|
||||
然后,输入 Neofetch 就可以运行啦。
|
||||
And then just enter neoftech to run the command.
|
||||
|
||||
还有一个与 Neofetch 很像的工具,screenfetch。用哪个都行。
|
||||
There is also screenfetch, a similar tool to Neofetch. You can use either of them.
|
||||
|
||||
### 7. fortune: 看看命运如何
|
||||
### 7. fortune: Get your fortune told
|
||||
|
||||
开玩笑啦。这样的事情根本就不存在。
|
||||
Just kidding! There’s no such thing.
|
||||
|
||||
不过,幸运饼干仍然很流行,所以显然,人们喜欢阅读随机的预测或说法。
|
||||
However, fortune cookies are still fashionable and apparently, people like to read random predictions or teachings.
|
||||
|
||||
您可以在 Linux 终端中用 Fortune 命令达到类似效果:
|
||||
You can get a similar feature in the Linux terminal with the fortune command:
|
||||
|
||||
![fortune cookie linux][16]
|
||||
|
||||
你可以用下面的命令安装它。
|
||||
You can install it using the following command:
|
||||
|
||||
```
|
||||
sudo apt install fortune
|
||||
```
|
||||
|
||||
装好之后,在终端中输入 fortunate 来得到一条随机消息。
|
||||
Once installed, just enter fortune in the terminal to get a random message.
|
||||
|
||||
### 8. pv: Make things animated
|
||||
|
||||
这是非预期使用 Linux 命令的典型例子。pv 命令本来用于通过管道监控数据的进度。
|
||||
This is a classic example of the unintended use of a Linux command. The pv command is used to monitor the progress of data through pipe.
|
||||
|
||||
但您可以使用它来对显示任何命令的输出加入动画效果。将其与上述的命令结合起来,您就可以看到 ASCII 字符画逐渐显现在屏幕上,就像正在输入一样。
|
||||
But you can use it to animate the output of any command. Combine it with some of the above-mentioned commands and you can see the ASCII art appearing on your screen as if it is being typed.
|
||||
|
||||
不太明白?看看这个:
|
||||
Don’t get it? Watch this video:
|
||||
|
||||
![A Video from YouTube][17]
|
||||
|
||||
用下面的命令安装:
|
||||
Install it using the following command:
|
||||
|
||||
```
|
||||
sudo apt install pv
|
||||
```
|
||||
|
||||
然后按这样使用:
|
||||
And then use it in the following manner:
|
||||
|
||||
```
|
||||
neofetch | pv -qL 200 | lolcat
|
||||
```
|
||||
|
||||
数字越大,速度越快。
|
||||
The higher the number, the higher will be the speed.
|
||||
|
||||
### 9. cmatrix: 类似黑客帝国的 ASCII 动画
|
||||
### 9. cmatrix: Matrix like animation in ASCII
|
||||
|
||||
还记得 "黑客帝国 "吗?下落的绿色代码是黑客帝国和黑客的象征。
|
||||
Remember the cult geek move Matrix? The green falling code is synonymous with Matrix and hacking.
|
||||
|
||||
您可以使用 cmatrix 命令在 Linux 终端用 ASCII 模拟运行下落代码。
|
||||
You can run an ASCII simulation of the falling code in the Linux terminal with cmatrix command.
|
||||
|
||||
我在这里用一张图片代替视频。
|
||||
I am sharing a screenshot instead of animation here.
|
||||
|
||||
![cmatrix][18]
|
||||
|
||||
你可以用 apt 安装他:
|
||||
You can install it with apt command:
|
||||
|
||||
```
|
||||
sudo apt install cmatrix
|
||||
```
|
||||
|
||||
安装好之后,用它运行:
|
||||
Once installed, you can run it with:
|
||||
|
||||
```
|
||||
cmatrix
|
||||
```
|
||||
|
||||
它会立即启动,并不断生成随机的绿色文本,带着从屏幕上落下后消失的动画效果。该命令会持续运行。使用 Ctrl+C 停止运行程序。
|
||||
It starts the animation immediately and it keeps on generating random green text falling and disappearing from the screen. The command keeps on running. To [stop the running application][19], use the Ctrl+C keys.
|
||||
|
||||
### 10. cbonsai: Grow a bonsai in your terminal
|
||||
|
||||
有没有园艺的天赋?在终端中种植一棵 ASCII 盆景树怎么样?
|
||||
Got a green thumb? How about growing an ASCII bonsai tree in the terminal?
|
||||
|
||||
cbonsai 是一个可让您以 ASCII 格式运行盆景树生长动画的有趣 Linux 命令。
|
||||
cbonsai is a [fun Linux command][20] that lets you run bonsai tree growing animation in ASCII format.
|
||||
|
||||
几天前我发了一条关于 cbonsai 命令的 YouTube 短视频。
|
||||
I shared a YouTube Shorts of cbonsai command a few days ago.
|
||||
|
||||
![Have fun with the Linux terminal 😍 🐧][21]
|
||||
|
||||
[订阅我们的 YouTube 频道,查看更多关于 Linux 的视频][22]
|
||||
[Subscribe to our YouTube channel for more Linux videos][22]
|
||||
|
||||
你可以用下面的命令安装 cbonsai:
|
||||
You can install cbonsai using:
|
||||
|
||||
```
|
||||
sudo apt install cbonsai
|
||||
```
|
||||
|
||||
用这行命令运行:
|
||||
And then to run the animation, use this command:
|
||||
|
||||
```
|
||||
cbonsai -l
|
||||
@ -242,17 +243,17 @@ cbonsai -l
|
||||
|
||||
### Try some more
|
||||
|
||||
还有很多这样的有趣的命令行工具,甚至还有[ASCII 游戏][23]。有时,看着它们给周围的人带来欢乐真的很有趣。
|
||||
There are many more such fun CLI tools. Heck, there are [ASCII games][23] as well. It’s fun to use them at times to amuse people around you.
|
||||
|
||||
这些命令能派上用场吗?我不确定是否可用,但你可以在 .bashrc 文件中添加其中一些,这样一旦打开终端会话,命令就会立即运行。
|
||||
Can you put these commands to some good use? Not certain about the usability, but you can add some of them in your .bashrc file so that the command is run as soon as you open a terminal session.
|
||||
|
||||
许多系统管理员在共享的 Linux 系统上都会这样做。像 cowsay 或 figlet 这样的程序可以用来以漂亮的方式显示消息或系统概况。
|
||||
Many sys-admins do that on shared Linux systems. A program like cowsay or figlet can be used to display a message or system info in a pretty way.
|
||||
|
||||
您也可以在您的 bash 脚本中使用其中的一些程序,尤其是当您需要突出显示某些内容时。
|
||||
You may also use some of these programs in your bash scripts, especially if you have to highlight something.
|
||||
|
||||
ASCII 字符画在 Linux 中可能还会有其他用途。你可以与我们分享。
|
||||
There could be other usages of ASCII art in Linux. I let you share them with the rest of us here.
|
||||
|
||||
#### 阅读更多
|
||||
#### Read More Articles
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user