View System and OS Information Using Screenfetch
ScreenFetch is a handy bash script to display the important information of the system and operating system. It auto detects the OS distribution and display an ASCII version of distribution logo and valuable system information to its right.
Being the owner or administrator of the system it is very important that you should “know your stuff well” and well aware of the machine you are playing with. Today, to achieve this easily we are trying to demonstrate a handy bash script called ScreenFetch. We are using ubuntu 18.04 for demonstration of this tutorial.
Ubuntu & Debain
apt install screenfetch
After Installing Homebrew
brew install screenfetch
Download the latest source at https://github.com/KittyKatt/screenFetch
wget -O screenfetch-dev https://git.io/vaHfR
Making the file executable
chmod +x screenfetch-dev
— Execute script from the present working directory.
— Either create an alias in /usr/bin to execute the script from anywhere without using the full path to the script.
— Or move it to somewhere in your $PATH to make it available without using the full path to the script.
After successful installation of Screenfetch. We can execute the script and get the system and OS information.
Information Provided by Screenfetch
|Username@hostname||Name of currently logged in user and hostname of the system.|
|Operating System||Name of the operating system that is installed in the system.|
|Kernel Version||Name of the kernel version that is installed in the operating system.|
|Uptime||The time system has been up and running since last reboot.|
|Packages||Number of packages that are installed in the operating system.|
|Shell||Name of the version of shell that is installed in the operating system.|
|Resolution||Display’s current resolution size.|
|DE||Name of currently installed desktop environment in the OS.|
|WM||Name of currently installed window manager.|
|WM Theme||Name of currently theme that is installed in window manager.|
|GTK Theme||Name of currently installed graphical user interface toolkit.|
|Icon Theme||Name of the icon theme that is installed for the DE.|
|Font||Name of the font which is currently being used.|
|CPU||Name of central processing unit and its speed.|
|GPU||Name of graphics processing unit|
|RAM||Memory size supported by the system|
vikas@demo:~$ screenfetch -h
Sample used cases for using Screenfetch
Use it at the time of user login
We can execute the script as soon as user login into the terminal. To perform such task we have to add the below line to the end of ~/.bashrc file.
if [ -f /usr/bin/screenfetch ]; then screenfetch; fi
Save and exit the ~/.bashrc after making the changes. You will be amazed to see that script gets auto executed when you open the terminal next time.
Use it in between your shell script for fetching some useful information provided by screenfetch
You can also use the output of screenfetch in various other scripts using the help of commands like awk and cut to get the desired value.
This brings us to the end of this tutorial. Hope you enjoyed this post. kindly share your feedback in comments section below. See you sooner with other interesting articles and blogs.