1. Overview

In this tutorial, we’ll learn how to display important system information while using the command line. Specifically, this might include data such as the distribution name, version number, kernel, CPU, GPU, and memory.

This information can help us analyze faulty system behavior and provide all the details we need to successfully troubleshoot problems.

2. Neofetch

Luckily, we have an easy, streamlined way to gather all the information we need simultaneously.

In order to accomplish this task, we make use of Neofetch, which is generally considered to be the status quo for displaying any system information being available for nearly 150 different operating systems and is open-source software.

With this in mind, let’s get into the installation, usage, and configuration of Neofetch.

2.1. Installation

Because of its universal acceptance, chances are we can install Neofetch easily using our distributions package manager.

To install Neofetch on any Ubuntu-based operating system, we invoke:

$ sudo apt install neofetch

On Fedora-based operating systems, we use:

$ sudo dnf install neofetch

If we are running Arch, it’s:

$ pacman -S neofetch

And Neofetch is also available on macOS if we’re using Homebrew:

$ brew install neofetch

For other operating systems and distributions the installation works similarly. Furthermore, we can consult the extensive Neofetch installation page if any questions arise.

2.2. Usage

Let’s start by invoking neofetch and see what happens:

$ neofetch
             /////////////                demo@baeldung 
         /////////////////////            ------------- 
      ///////*767////////////////         OS: Pop!_OS 20.04 LTS x86_64 
    //////7676767676*//////////////       Host: VirtualBox 1.2 
   /////76767//7676767//////////////      Kernel: 5.4.0-7626-generic 
  /////767676///*76767///////////////     Uptime: 8 hours, 23 mins 
 ///////767676///76767.///7676*///////    Packages: 1869 (dpkg) 
/////////767676//76767///767676////////   Shell: bash 5.0.16 
//////////76767676767////76767/////////   Resolution: 1440x900 
///////////76767676//////7676//////////   DE: GNOME 
////////////,7676,///////767///////////   WM: Mutter 
/////////////*7676///////76////////////   WM Theme: Pop 
///////////////7676////////////////////   Theme: Pop-dark [GTK2/3] 
 ///////////////7676///767////////////    Icons: Pop [GTK2/3] 
  //////////////////////'////////////     Terminal: gnome-terminal 
   //////.7676767676767676767,//////      CPU: Intel i7-9750H (4) @ 2.591GHz 
    /////767676767676767676767/////       GPU: 00:02.0 VMware SVGA II Adapter 
      ///////////////////////////         Memory: 1186MiB / 3935MiB 
         /////////////////////
             /////////////                                        
                                                                  

By default, Neofetch shows all the important information like our operating system, kernel, and several hardware statistics displayed.

2.3. Configuration

The output of neofetch is markedly customizable depending on our needs. Generally speaking, any changes can be made in one of two ways:

  • Editing neofetch‘s configuration file
  • Supplying command-line arguments to neofetch

By default, we can find the configuration file under $HOME/.config/neofetch/config, though this is configurable.

Even though the configuration file is a bash script that we could manually modify, we’re going to use command line arguments to make it easier to follow along.

By using the –disable switch followed by the metric, we are able to remove undesired output:

$ neofetch --disable model
             /////////////                demo@baeldung 
         /////////////////////            ------------- 
      ///////*767////////////////         OS: Pop!_OS 20.04 LTS x86_64 
    //////7676767676*//////////////       Kernel: 5.4.0-7626-generic 
   /////76767//7676767//////////////      Uptime: 9 hours, 9 mins 
  /////767676///*76767///////////////     Packages: 1869 (dpkg) 
 ///////767676///76767.///7676*///////    Shell: bash 5.0.16 
/////////767676//76767///767676////////   Resolution: 1440x900 
//////////76767676767////76767/////////   DE: GNOME 
///////////76767676//////7676//////////   WM: Mutter 
////////////,7676,///////767///////////   WM Theme: Pop 
/////////////*7676///////76////////////   Theme: Pop-dark [GTK2/3] 
///////////////7676////////////////////   Icons: Pop [GTK2/3] 
 ///////////////7676///767////////////    Terminal: gnome-terminal 
  //////////////////////'////////////     CPU: Intel i7-9750H (4) @ 2.591GHz 
   //////.7676767676767676767,//////      GPU: 00:02.0 VMware SVGA II Adapter 
    /////767676767676767676767/////       Memory: 1194MiB / 3935MiB 
      ///////////////////////////
         /////////////////////                                    
             /////////////

One fun customization is to change the ASCII logo that is displayed on the left side. We can choose another ASCII logo by using the –ascii_distro argument:

$ neofetch --ascii_distro SteamOS
              .,,,,.                  demo@baeldung 
        .,'onNMMMMMNNnn',.            ------------- 
     .'oNMANKMMMMMMMMMMMNNn'.         OS: Pop!_OS 20.04 LTS x86_64 
   .'ANMMMMMMMXKNNWWWPFFWNNMNn.       Host: VirtualBox 1.2 
  ;NNMMMMMMMMMMNWW'' ,.., 'WMMM,      Kernel: 5.4.0-7626-generic 
 ;NMMMMV+##+VNWWW' .+;'':+, 'WMW,     Uptime: 9 hours, 16 mins 
,VNNWP+######+WW,  +:    :+, +MMM,    Packages: 1869 (dpkg) 
'+#############,   +.    ,+' +NMMM    Shell: bash 5.0.16 
  '*#########*'     '*,,*' .+NMMMM.   Resolution: 1440x900 
     `'*###*'          ,.,;###+WNM,   DE: GNOME 
         .,;;,      .;##########+W    WM: Mutter 
,',.         ';  ,+##############'    WM Theme: Pop 
 '###+. :,. .,; ,###############'     Theme: Pop-dark [GTK2/3] 
  '####.. `'' .,###############'      Icons: Pop [GTK2/3] 
    '#####+++################'        Terminal: gnome-terminal 
      '*##################*'          CPU: Intel i7-9750H (4) @ 2.591GHz 
         ''*##########*''             GPU: 00:02.0 VMware SVGA II Adapter 
              ''''''                  Memory: 1202MiB / 3935MiB 

                                                              

We can use any ASCII file or image or even turn it off completely:

$ neofetch --off
demo@baeldung 
------------- 
OS: Pop!_OS 20.04 LTS x86_64 
Host: VirtualBox 1.2 
Kernel: 5.4.0-7626-generic 
Uptime: 9 hours, 23 mins 
Packages: 1869 (dpkg) 
Shell: bash 5.0.16 
Resolution: 1440x900 
DE: GNOME 
WM: Mutter 
WM Theme: Pop 
Theme: Pop-dark [GTK2/3] 
Icons: Pop [GTK2/3] 
Terminal: gnome-terminal 
CPU: Intel i7-9750H (4) @ 2.591GHz 
GPU: 00:02.0 VMware SVGA II Adapter 
Memory: 1194MiB / 3935MiB

In case we’re only interested in a few select statistics, we can also specify the ones we want to display:

neofetch distro kernel
distro: Pop!_OS 20.04 LTS x86_64 
kernel: 5.4.0-7626-generic

Neofetch offers many other options to customize the output. Please refer to Customizing Info over on Neofetch Wiki to learn about all the possibilities.

3. Conclusion

In this short tutorial, we learned how to install, use, and configure Neofetch to display system information.