使用 CPUFetch 在 Linux 终端中漂亮地显示 CPU 细节
CPU
![](/data/attachment/album/202104/12/093818iie270mi8am6ttk7.jpg)


Linux 上有 [检查 CPU 信息的方法](https://linuxhandbook.com/check-cpu-info-linux/)。最常见的可能是 `lscpu` 命令，它可以提供大量的系统上所有 CPU 核心的信息。


![lscpu command output](/data/attachment/album/202104/12/093846z7vxfz8dcv1jlssx.png)


你可以在那里找到 CPU 信息，而无需安装任何额外的包。当然这是可行的。然而，我最近偶然发现了一个新的工具，它以一种漂亮的方式显示 Linux 中的 CPU 细节。


处理器制造商的 ASCII 艺术使它看起来很酷。


![](/data/attachment/album/202104/12/093847qkyta4srk2uwttai.png)


这看起来很美，不是吗？这类似于 [Neoftech 或者 Screenfetch，在 Linux 中用漂亮的 ASCII 艺术来展示系统信息](https://itsfoss.com/display-linux-logo-in-ascii/)。与这些工具类似，如果你要展示你的桌面截图，可以使用 CPUFetch。


该工具可以输出处理器制造商的 ASCII 艺术，它的名称、微架构、频率、核心、线程、峰值性能、缓存大小、[高级向量扩展](https://software.intel.com/content/www/us/en/develop/articles/introduction-to-intel-advanced-vector-extensions.html) 等等。


除了它提供的一些主题外，你还可以使用自定义颜色。当你在整理桌面，并希望对 Linux 环境中的所有元素进行颜色匹配时，这给了你更多的自由度。


### 在 Linux 上安装 CPUFetch


不幸的是，CPUFetch 是一个相当新的软件，而且它并不包含在你的发行版的软件库中，甚至没有提供现成的 DEB/RPM 二进制文件、PPA、Snap 或 Flatpak 包。


Arch Linux 用户可以在 [AUR](https://itsfoss.com/aur-arch-linux/) 中 [找到](https://aur.archlinux.org/packages/cpufetch-git) 它，但对于其他人来说，唯一的出路是 [从源代码构建](https://itsfoss.com/install-software-from-source-code/)。


不要担心。安装以及删除并不是那么复杂。让我来告诉你步骤。


我使用的是 Ubuntu，你会 [需要先在 Ubuntu 上安装 Git](https://itsfoss.com/install-git-ubuntu/)。一些发行版会预装 Git，如果没有，请使用你的发行版的包管理器来安装。


现在，把 Git 仓库克隆到你想要的地方。家目录也可以。



```
git clone https://github.com/Dr-Noob/cpufetch

```

切换到你刚才克隆的目录：



```
cd cpufetch

```

你会在这里看到一个 Makefile 文件。用它来编译代码。



```
make

```

![CPUFetch Installation](/data/attachment/album/202104/12/093848ytzplqlteqq6y6qi.png)


现在你会看到一个新的可执行文件，名为 `cpufetch`。你运行这个可执行文件来显示终端的 CPU 信息。



```
./cpufetch

```

这是我系统的显示。AMD 的徽标用 ASCII 码看起来更酷，你不觉得吗？


![](/data/attachment/album/202104/12/093848dz5eg33uu2gweg0g.png)


如何删除 CPUFetch？这很简单。当你编译代码时，它只产生了一个文件，而且也和其他代码在同一个目录下。


所以，要想从系统中删除 CPUFetch，只需删除它的整个文件夹即可。你知道 [在 Linux 终端中删除一个目录](https://linuxhandbook.com/remove-files-directories/) 的方法吧？从 `cpufetch` 目录中出来，然后使用 `rm` 命令。



```
rm -rf cpufetch

```

这很简单，值得庆幸的是，因为从源代码中删除安装的软件有时真的很棘手。


说回 CPUFetch。我想这是一个实用工具，适合那些喜欢在各种 Linux 群里炫耀自己桌面截图的人。既然发行版有了 Neofetch，CPU 有了 CPUFetch，不知道能不能也来个 Nvidia ASCII 艺术的 GPUfetch？




---


via: <https://itsfoss.com/cpufetch/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题：[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
![Warp Terminal](/assets/images/warp-terminal.webp)


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

There are [ways to check CPU information on Linux](https://linuxhandbook.com/check-cpu-info-linux/?ref=itsfoss.com). Probably the most common is the `lscpu`

command that gives you plenty of information about all the CPU cores on your system.

![lscpu command output](https://itsfoss.com/content/images/wordpress/2021/04/lscpu-command-output-800x415.png)

You may find CPU information there without installing any additional packages. That works of course. However, I recently stumbled upon a new tool that displays the CPU details in Linux in a beautiful manner.

The ASCII art of the processor manufacturer makes it look cool.

![cpufetch for AMD processor](https://itsfoss.com/content/images/wordpress/2021/04/cpufetch-1-800x307.png)

This looks beautiful, isn’t it? This is similar to [Neofetch or Screenfetch tools that show the system information in beautiful ASCII art in Linux](https://itsfoss.com/display-linux-logo-in-ascii/). Similar to those tools, you can use CPUFetch if you are showcasing your desktop screenshot.

The tool outputs the ASCII art of the processor manufacturer, its name, microarchitecture, frequency, cores, threads, peak performance, cache sizes, [Advanced Vector Extensions](https://software.intel.com/content/www/us/en/develop/articles/introduction-to-intel-advanced-vector-extensions.html?ref=itsfoss.com), and more.

You can use custom colors apart from a few themes it provides. This gives you additional degree of freedom when you are ricing your desktop and want to color match all the elements on your Linux setup.

## Installing CPUFetch on Linux

Unfortunately, CPUFetch is rather new, and it is not included in your distribution’s repository. It doesn’t even provide ready to use DEB/RPM binaries, PPAs, Snap or Flatpak packages.

Arch Linux users can [find](https://aur.archlinux.org/packages/cpufetch-git?ref=itsfoss.com) it in [AUR](https://itsfoss.com/aur-arch-linux/) but for others, the only way forward here is to [build from source code](https://itsfoss.com/install-software-from-source-code/).

Don’t worry. Installation as well as removal is not that complicated. Let me show you the steps.

I am using Ubuntu and you would [need to install Git on Ubuntu first](https://itsfoss.com/install-git-ubuntu/). Some other distributions come preinstalled with it, if not use your distribution’s package manager to install it.

Now, clone the Git repository wherever you want. Home directory is fine as well.

`git clone https://github.com/Dr-Noob/cpufetch`


Switch to the directory you just cloned:

`cd cpufetch`


You’ll see a make file here. Use it to compile the code.

`make`


![cpufetch installation](https://itsfoss.com/content/images/wordpress/2021/04/cpufetch-installation-800x410.png)

Now you’ll see a new executable file named `cpufetch`

. You run this executable to display the CPU information in the terminal.

`./cpufetch`


This is what it showed for my system. AMD logo looks a lot cooler in ASCII, don’t you think?

![cpufetch showing CPU information in Linux terminal for itsfoss](https://itsfoss.com/content/images/wordpress/2021/04/cpufetch-for-itsfoss-800x335.png)

How do you remove Cpufetch? It’s pretty simple. When you compiled the code, it produced just one file and that too in the same directory as the rest of the code.

So, to remove CPUFetch from your system, simply remove its entire folder. You know how to [remove a directory in Linux terminal](https://linuxhandbook.com/remove-files-directories/?ref=itsfoss.com), don’t you? Come out of the cpufetch directory and use the rm command:

`rm -rf cpufetch`


That was simple, thankfully because removing software installed from source code could be really tricky at times.

Back to cpufetch. I think it’s a utility for those who like to show off their desktop screenshots in various Linux group. Since we have [Neofetch](https://itsfoss.com/using-neofetch/) for the distribution and CPUFetch for CPU, I wonder if we could have a GPU fetch with ASCII art of Nvidia as well :)