35

pfetch Linux and Unix hardware information tool

 4 years ago
source link: https://www.tuicool.com/articles/mYFFre6
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

T heneofetch command like utility written in a bash shell. The main purpose of neofetch is to be used in screenshots to display other users what operating system or Linux distro you are using including theme, icons, hardware config and more. Now we have another tool called pfetch. It is a pretty system information tool written in POSIX sh. Let us see how to install and use pfetch Linux and Unix hardware information tool.

pfetch Linux and Unix hardware info script

From the project page:

The goal of this project is to implement a simple system information tool in POSIX sh using features built into the language itself (where possible).
The source code is highly documented and I hope it will act as a learning resource for POSIX sh and simple information detection across various different operating systems.
If anything in the source code is unclear or is lacking in its explanation, open an issue. Sometimes you get too close to something and you fail to see the “bigger picture”!

Installation

Use the wget command on Linux or Unix to install pfetch:

wget https://github.com/dylanaraps/pfetch/archive/master.zip

Use the unzip command or tar command to unzip the file named master.zip on Linux or Unix :

unzip master.zip

Install the file using install command:

sudo install pfetch-master/pfetch /usr/local/bin/
 ls -l /usr/local/bin/pfetch

Cloning git repo (alternate installation method)

One can try the git command and clone the pfetch repo on macOS/BSD/Linux and Unix systems too:

git clone https://github.com/dylanaraps/pfetch.git

Install it:

sudo install pfetch/pfetch /usr/local/bin/
 ls -l /usr/local/bin/pfetch
BNj2QrE.png!web

Usage

Now that pfetch installed, it is time to run it. Simply type:

pfetch

OR

/usr/local/bin/pfetch
NjmY7jV.png!web

OS support

  • Haiku
  • MacOS
  • Minix
  • Solaris
  • DragonflyBSD
  • FreeBSD
  • NetBSD
  • OpenBSD
  • Windows subsystem for Linux.
  • Various Linux disros such as Alpine Linux, Arch Linux, Ubuntu, CentOS, Debian, and more.

Configuration

You can control pfetch through shell environment variables. For example, just show os, kernel and uptime, run:

PF_INFO="ascii title os host kernel uptime" /usr/local/bin/pfetch

Sample outputs:

_    vivek@nixcraft-nuc02
     ---(_)   os     Ubuntu 18.04.3 LTS
 _/  ---  \   host   NUC7i7DNHE J85489-204
(_) |   |     kernel 5.0.0-29-generic
  \  --- _/   uptime 6d 19h 41m
     ---(_)

Conclusion

Overall it is a little and delightful system information tool written in POSIX sh. The code is fully documented very well. See project home page here for more information and options. If you like pfetch check out related tools:

This entry is 3 of 3 in the Linux/UNIX System Info Apps series. Keep reading the rest of the series:
  1. Display Awesome Linux Logo With Basic Hardware Info Using screenfetch/linux_logo
  2. neofetch: Awesome system info bash script for Linux/Unix
  3. pfetch Linux and Unix hardware information tool

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK