今天给大家分享一款Linux系统上的可以快捷查看设备系统信息的软件,即,neofetch。通过该软件,可以很方便的查询自己系统的信息及运行的状况,包括CPU、内存及硬盘的占用情况等。由于我用的是Centos Stream系统,这里就以该系统为例讲解neofetch安装及使用方法,其他系统类似,安装命令就跟你安装其他软件一致。
Neofetch安装
终端输入如下命令即可开始安装neofetch
#Centos Stream系统
dnf install neofetch
Neofetch使用
使用非常简单,只需要在终端里输入neofetch即可
[root@iZwz98biiph4vhee88vxj8Z ~]# neofetch
.. root@iZwz98biiph4vhee88vxj8Z
.PLTJ. ----------------------------
<><><><> OS: CentOS Stream release 8 x86_64
KKSSV' 4KKK LJ KKKL.'VSSKK Host: Alibaba Cloud ECS pc-i440fx-2.1
KKV' 4KKKKK LJ KKKKAL 'VKK Kernel: Linux 4.18.0-408.el8.x86_64
V' ' 'VKKKK LJ KKKKV' ' 'V Uptime: 24 days, 17 hours, 33 mins
.4MA.' 'VKK LJ KKV' '.4Mb. Packages: 984 (rpm)
. KKKKKA.' 'V LJ V' '.4KKKKK . Shell: /bin/bash 4.4.20
.4D KKKKKKKA.'' LJ ''.4KKKKKKK FA. Terminal: /dev/pts/0
<QDD ++++++++++++ ++++++++++++ GFD> CPU: Intel Xeon Platinum 8269CY (1) @ 2.5GHz
'VD KKKKKKKK'.. LJ ..'KKKKKKKK FV Memory: 810MiB / 1731MiB (46%)
' VKKKKK'. .4 LJ K. .'KKKKKV ' CPU Usage: 4%
'VK'. .4KK LJ KKA. .'KV' Disk (/): 15G / 40G (36%)
A. . .4KKKK LJ KKKKA. . .4 Local IP: 172.27.233.198
KKA. 'KKKKK LJ KKKKK' .4KK Users: root
KKSSA. VKKK LJ KKKV .4SSKK -----------
<><><><>
'MKKM'
''
Hello, world
Login time: Sun Dec 4 13:33:40 CST 2022
Hi, My name is gugechor!
Neofetch配置
neofetch配置文件位于/root/.config/neofetch
目录下的config.conf
文件
print_info() {
info title
info underline
info "OS" distro
info "Host" model
info "Kernel" kernel
info "Uptime" uptime
info "Packages" packages
info "Shell" shell
# info "Resolution" resolution
# info "DE" de
# info "WM" wm
# info "WM Theme" wm_theme
# info "Theme" theme
# info "Icons" icons
info "Terminal" term
# info "Terminal Font" term_font
info "CPU" cpu
# info "GPU" gpu
info "Memory" memory
# info "GPU Driver" gpu_driver # Linux/macOS only
info "CPU Usage" cpu_usage
info "Disk" disk
# info "Battery" battery
# info "Font" font
# info "Song" song
# [[ "$player" ]] && prin "Music Player" "$player"
info "Local IP" local_ip
#info "Public IP" public_ip
info "Users" users
# info "Locale" locale # This only works on glibc systems.
info underline
info cols
# Using printf
printf "%s\n" "Hello, world"
printf "%s\n" "Login time: $(date)"
Usage: color num
color fg
prin "$(color 1)Hi, $(color 2)My $(color 3)name $(color 4)is $(color 5)gugechor!"
}
控制显示选项的主要是上述代码部分,这里列出了你在运行neofetch后,终端里显示的选项。其中,#
表示该行不显示,你可以删掉前面的#
以让其显示。
剩下的配置文件都是一些高级订制选项,比如内存是否显示占用百分比等。
Neofetch官方Github
安装教程:https://github.com/dylanaraps/neofetch/wiki/Installation
环境依赖:https://github.com/dylanaraps/neofetch/wiki/Dependencies
更多说明文件:https://github.com/dylanaraps/neofetch/wiki
原创文章,作者:古哥,转载需经过作者授权同意,并附上原文链接:https://iymark.com/articles/3641.html