How to Display System Information with Neofetch on Linux

How to Display System Information with Neofetch on Linux

Over the years Linux users have been known to write command line-based scripts that “fetch” or display system information from their machines. Multiple community based scripts of this type have come and gone, but the more popular ones out there are still being used today.

NeoFetch is one of these such scripts and looks to provide all the features and capabilities of its predecessors but in a much more comprehensive way.

Put simply, if you’ve ever wanted to check your hardware specifications, kernel version, uptime, desktop environment type, and more (with ease) – then a program like NeoFetch is what you’re looking for.

Installation

The following set of instructions are for an install of Neofetch on Debian/Ubuntu. NeoFetch is cross-platform so will work on most other systems, too (even Windows!).

The installation instructions are also readily available for Arch Linux, Gentoo, Fedora, and Mac OS X here on the project’s GitHub page.

It’s easiest to copy/paste these next three commands into your terminal, so there are no errors when entering.

Open a terminal and add the NeoFetch software repository by running:

echo "deb http://dl.bintray.com/dawidd6/neofetch jessie main" | sudo tee -a /etc/apt/sources.list

Then add the public key as trusted to your system by typing in:

curl -L "https://bintray.com/user/downloadSubjectPublicKey?username=bintray" -o Release-neofetch.key

Wait for the short download output to finish and enter:

sudo apt-key add Release-neofetch.key && rm Release-neofetch.key

You can now install Neofetch onto the machine with:

sudo apt-get update && sudo apt-get install neofetch scrot

Say “yes” to any prompts.

You now have the program ready to run on your Ubuntu machine.

Usage

How do you use NeoFetch to print out system information now that it’s installed? Thankfully it’s quite easy, It’s done simply by calling the program inside of the terminal using its name.

Enter this one-word command into your terminal to see your system specs output:

neofetch

Neofetch Default System Information Output

As you can see, the output is quite detailed. We can get a lot more use out of the program by going a little further and adding extra options to the command.

Here are some examples:

Change the memory statistic to a progress bar, and disable the colour blocks by appending:

neofetch --memory_display bar --color_blocks off

Neofetch Bar & No Colour Block System Information

Change the colours of the output text with this option:

neofetch --colors 7 7 5 11 7 9

Neofetch Coloured Output System Information

Save the system output details to a new image file by taking a screenshot:

neofetch --scrot /path/to/img

Replace “/path/to/img” in the location and file-name where you want your screenshot to be created. The full list of options you can use to create different outputs is available here.

Aliases

Typing out the extra parts of your custom commands can be a bit repetitive and time-consuming. To remedy this, we can create an “alias” for any custom NeoFetch outputs we want to run.

An alias is a shorter command that refers to another much longer command. These aliases are best stored in your system’s “.bashrc” file.

Begin writing to this file now with Nano:

nano ~/.bashrc

Here’s an example alias to add to the bottom of the file that runs a longer NeoFetch command but with one word!

The backslashes continue the code on the next line instead of ending it abruptly, so one of these is needed on each new line (barring the last).

alias neofetch2="neofetch \
--block_range 1 8 \
--line_wrap off \
--bold off \
--uptime_shorthand on \
--gtk_shorthand on \
--colors 4 1 8 8 8 7 
"

Save and leave this file by pressing “Ctrl + x” together at the same time on your keyboard, followed by one press of the “y” key to confirm.

Nearly done!

Source the “.bashrc” file so the changes are picked up:

source ~/.bashrc

Now try running the new Neofetch alias we defined to see the customised output! Remember we called it “neofetch2”:

neofetch2

Neofetch Alias Output

The terminal output shows the results! If you got an error go back to the “.bashrc” file from earlier and check that your alias is written down correctly.

Conclusion

If you’ve never used one of these tools before, you’ll find it a welcome addition to your repertoire. Although not super essential, it’s nice to have an easy way to quickly see system specs on the fly, and there’s no end to the amount of aliases you can add to make things smoother. Have fun using this one!

Christian Scarlett
Christian Scarlett

Christian has been involved with technology in some way or another for most of his life and has spent the majority of his time working with Linux and open-source software as a system admin. Recently he’s taken to freelance writing for both cloud hosting providers and tech blogging sites.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox