使用 Bash 工具截屏 Linux 系统配置
ScreenFetch Neofetch

> 
> 使用 ScreenFetch 和 Neofetch 与其他人轻松分享你的 Linux 环境。
> 
> 
> 


![](/data/attachment/album/202002/23/124525yiiqs18ll736oro8.jpg)


你可能有很多原因想要与他人分享你的 Linux 配置。你可能正在寻求帮助来对系统上的问题进行故障排除，或者你对所创建的环境感到非常自豪，因此想向其他开源爱好者展示。


你可以在 Bash 提示符下使用 `cat /proc/cpuinfo` 或 `lscpu` 命令获取某些信息。但是，如果你想共享更多详细信息，例如你的操作系统、内核、运行时间、shell 环境，屏幕分辨率等，那么可以选择两个很棒的工具：screenFetch 和 Neofetch。


### screenFetch


[screenFetch](https://github.com/KittyKatt/screenFetch) 是 Bash 命令行程序，它可以产生非常漂亮的系统配置和运行时间的截图。这是方便的与它人共享系统配置的方法。


在许多 Linux 发行版上安装 screenFetch 很简单。


在 Fedora 上，输入：



```
$ sudo dnf install screenfetch
```

在 Ubuntu 上，输入：



```
$ sudo apt install screenfetch
```

对于其他操作系统，包括 FreeBSD、MacOS 等，请查阅 screenFetch 的 wiki [安装页面](https://github.com/KittyKatt/screenFetch/wiki/Installation)。安装 screenFetch 后，它可以生成详细而彩色的截图，如下所示：


![screenFetch](/data/attachment/album/202002/23/124554oyefaflsi7sp5j9f.png "screenFetch")


ScreenFetch 还提供各种命令行选项来调整你的结果。例如，`screenfetch -v` 返回详细输出，逐行显示每个选项以及上面的显示。


`screenfetch -n` 在显示系统信息时消除了操作系统图标。


![screenfetch -n option](/data/attachment/album/202002/23/124601yqqnrqerqqi7683q.png "screenfetch -n option")


其他选项包括 `screenfetch -N`，它去除所有输出的颜色。`screenfetch -t`，它根据终端的大小截断输出。`screenFetch -E`，它可抑制错误输出。


请检查手册页来了解其他选项。screenFetch 在 GPLv3 许可证下的开源，你可以在它的 [GitHub 仓库](http://github.com/KittyKatt/screenFetch)中了解有关该项目的更多信息。


### Neofetch


[Neofetch](https://github.com/dylanaraps/neofetch) 是创建系统信息截图的另一个工具。它是用 Bash 3.2 编写的，在 [MIT 许可证](https://github.com/dylanaraps/neofetch/blob/master/LICENSE.md)下开源。


根据项目网站所述，“Neofetch 支持近 150 种不同的操作系统。从 Linux 到 Windows，一直到 Minix、AIX 和 Haiku 等更晦涩的操作系统。”


![Neofetch](/data/attachment/album/202002/23/124626wa72qc57tglll500.png "Neofetch")


该项目维护了一个 wiki，其中包含用于各种发行版和操作系统的出色的[安装文档](https://github.com/dylanaraps/neofetch/wiki/Installation)。


如果你使用的是 Fedora、RHEL 或 CentOS，那么可以在 Bash 提示符下使用以下命令安装 Neofetch：



```
$ sudo dnf install neofetch
```

在 Ubuntu 17.10 及更高版本上，你可以使用：



```
$ sudo apt install neofetch
```

首次运行时，Neofetch 将 `~/.config/neofetch/config.conf` 文件写入主目录（`.config/config.conf`），它让你可以[自定义和控制](https://github.com/dylanaraps/neofetch/wiki/Customizing-Info) Neofetch 输出的各个方面。例如，你可以配置 Neofetch 使用图像、ASCII 文件、你选择的壁纸，或者完全不使用。config.conf 文件还让与它人分享配置变得容易。


如果 Neofetch 不支持你的操作系统或不提供所需选项，请在项目的 [GitHub 仓库](https://github.com/dylanaraps/neofetch/issues)中打开一个问题。


### 总结


无论为什么要共享系统配置，screenFetch 或 Neofetch 都应该能做到。你是否知道在 Linux 上提供此功能的另一个开源工具？请在评论中分享你的最爱。




---


via: <https://opensource.com/article/20/1/screenfetch-neofetch>


作者：[Don Watkins](https://opensource.com/users/don-watkins) 选题：[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
There are many reasons you might want to share your Linux configuration with other people. You might be looking for help troubleshooting a problem on your system, or maybe you're so proud of the environment you've created that you want to showcase it to fellow open source enthusiasts.


You could get some of that information with a **cat /proc/cpuinfo** or **lscpu** command at the Bash prompt. But if you want to share more details, such as your operating system, kernel, uptime, shell environment, screen resolution, etc., you have two great tools to choose: screenFetch and Neofetch.

## ScreenFetch

[ScreenFetch](https://github.com/KittyKatt/screenFetch) is a Bash command-line utility that can produce a very nice screenshot of your system configuration and uptime. It is an easy way to share your system's configuration with others in a colorful way.

It's simple to install screenFetch for many Linux distributions.

On Fedora, enter:

`$ sudo dnf install screenfetch`


On Ubuntu, enter:

`$ sudo apt install screenfetch`


For other operating systems, including FreeBSD, MacOS, and more, consult the screenFetch wiki's [installation page](https://github.com/KittyKatt/screenFetch/wiki/Installation). Once screenFetch is installed, it can produce a detailed and colorful screenshot like this:

![screenFetch screenFetch](https://opensource.com/sites/default/files/uploads/screenfetch.png)

ScreenFetch also provides various command-line options to fine-tune your results. For example, **screenfetch -v** returns verbose output that presents each option line-by-line along with the display shown above.

And **screenfetch -n** eliminates the operating system icon when it displays your system information.

![screenfetch -n option screenfetch -n option](https://opensource.com/sites/default/files/uploads/screenfetch-n.png)

Other options include **screenfetch -N**, which strips all color from the output; **screenfetch -t**, which truncates the output depending on the size of the terminal; and **screenFetch -E**, which suppresses errors.

Be sure to check the man page on your system for other options. ScreenFetch is open source under the GPLv3, and you can learn more about the project in its [GitHub repository](http://github.com/KittyKatt/screenFetch).

## Neofetch

[Neofetch](https://github.com/dylanaraps/neofetch) is another tool to create a screenshot with your system information. It is written in Bash 3.2 and is open source under the [MIT License](https://github.com/dylanaraps/neofetch/blob/master/LICENSE.md).

According to the project's website, "Neofetch supports almost 150 different operating systems. From Linux to Windows, all the way to more obscure operating systems like Minix, AIX, and Haiku."

![Neofetch Neofetch](https://opensource.com/sites/default/files/uploads/neofetch.png)

The project maintains a wiki with excellent [installation documentation](https://github.com/dylanaraps/neofetch/wiki/Installation) for a variety of distributions and operating systems.

If you are on Fedora, RHEL, or CentOS, you can install Neofetch at the Bash prompt with:

`$ sudo dnf install neofetch`


On Ubuntu 17.10 and greater, you can use:

`$ sudo apt install neofetch`


On its first run, Neofetch writes a **~/.config/neofetch/config.co nf** file to your home directory (

**.config/config.conf**), which enables you to

[customize and control](https://github.com/dylanaraps/neofetch/wiki/Customizing-Info)every aspect of Neofetch's output. For example, you can configure Neofetch to use the image, ASCII file, or wallpaper of your choice—or nothing at all. The config.conf file also makes it easy to share your customization with others.

If Neofetch doesn't support your operating system or provide all the options you are looking for, be sure to open up an issue in the project's [GitHub repo](https://github.com/dylanaraps/neofetch/issues).

## Conclusion

No matter why you want to share your system configuration, screenFetch or Neofetch should enable you to do so. Do you know of another open source tool that provides this functionality on Linux? Please share your favorite in the comments.

## 3 Comments