How to Use the Command 'neofetch' (with examples)
Neofetch is a command-line system information tool written in Bash. It displays information about your operating system, software, and hardware using the terminal. Neofetch is highly customizable, allowing users to tweak what information they want to display and how it appears. The output typically includes the OS name, kernel version, uptime, packages installed, shell, resolution, DE/WM, theme, icons, terminal, CPU, GPU, RAM, and more. This is particularly useful for people who want to display a quick system summary or for users who want to show off their system specs in forums or on social media.
Use case 1: Return the default config, and create it if it’s the first time the program runs
Code:
neofetch
Motivation:
Running neofetch
without any additional arguments is perhaps the most straightforward way to see what the command can do for you. Since this command returns the default configuration and creates it if it’s your first time using Neofetch, it ensures you have a baseline understanding of your system’s core information. For new users, simply executing this command serves as an introduction to the breadth of details that can be displayed and customized.
Explanation:
neofetch
by itself is a simple invocation that tells the program to execute using its default configuration. When run for the first time, it creates the default configuration file in the user’s home directory, enabling further customization later on. This approach allows users to become familiar with Neofetch through initial exposure to its default settings without making immediate changes.
Example Output:
OS: Ubuntu 22.04 LTS x86_64
Kernel: 5.11.0-40-generic
Uptime: 3 days, 4 hours, 20 mins
Packages: 1825 (dpkg)
Shell: bash 5.1.8
Resolution: 1920x1080
DE: GNOME 3.36.8
WM: Mutter
Theme: Yaru-dark [GTK2/3]
Icons: Yaru [GTK2/3]
Terminal: gnome-terminal
CPU: AMD Ryzen 5 3600 (12) @ 3.600GHz
GPU: NVIDIA GeForce GTX 1650
RAM: 16GB
Use case 2: Trigger an info line from appearing in the output
Code:
neofetch --enable|disable memory
Motivation: Neofetch’s ability to customize which pieces of system information are displayed allows users to tailor the output to their preferences or needs. For instance, if you’re looking to share your system’s specs but want to keep certain information hidden for privacy reasons — such as your memory usage — this tool allows you to easily disable details you don’t want to include. Conversely, enabling specific lines makes your output more relevant to your audience and purpose.
Explanation:
--enable
or--disable
are arguments that control the visibility of specific lines of information. In this example, usingmemory
, you can toggle whether your system’s memory usage information is included in the output.
Example Output (memory disabled):
OS: Ubuntu 22.04 LTS x86_64
Kernel: 5.11.0-40-generic
Uptime: 3 days, 4 hours, 20 mins
Packages: 1825 (dpkg)
Shell: bash 5.1.8
Resolution: 1920x1080
DE: GNOME 3.36.8
WM: Mutter
Theme: Yaru-dark [GTK2/3]
Icons: Yaru [GTK2/3]
Terminal: gnome-terminal
CPU: AMD Ryzen 5 3600 (12) @ 3.600GHz
GPU: NVIDIA GeForce GTX 1650
Use case 3: Hide/Show OS architecture
Code:
neofetch --os_arch on|off
Motivation: Customizing the visibility of your OS architecture in Neofetch can be vital when you wish to display a cleaner look or when you want to emphasize other system features. For example, when sharing your setup with others in a forum, you might prefer to hide the OS architecture to keep the focus on other technical specifications or because it’s deemed unnecessary.
Explanation:
--os_arch on|off
is a toggle argument that determines whether the OS architecture is displayed in the output. When set toon
, it shows the architecture, such as x86_64 or ARM64, and when set tooff
, it omits this information.
Example Output (OS architecture hidden):
OS: Ubuntu 22.04 LTS
Kernel: 5.11.0-40-generic
Uptime: 3 days, 4 hours, 20 mins
Packages: 1825 (dpkg)
Shell: bash 5.1.8
Resolution: 1920x1080
DE: GNOME 3.36.8
WM: Mutter
Theme: Yaru-dark [GTK2/3]
Icons: Yaru [GTK2/3]
Terminal: gnome-terminal
CPU: AMD Ryzen 5 3600 (12) @ 3.600GHz
GPU: NVIDIA GeForce GTX 1650
RAM: 16GB
Use case 4: Enable/Disable CPU brand in output
Code:
neofetch --cpu_brand on|off
Motivation: Showing or hiding the CPU brand can be particularly useful for different scenarios, such as when participating in discussions where the brand is not relevant, or when privacy concerns are at play. Alternatively, highlighting the CPU brand might be critical when comparing it with others or when marketing your system’s strengths.
Explanation:
--cpu_brand on|off
is an option to control whether the CPU brand name (e.g., Intel, AMD) is shown in the terminal output. Turning iton
makes the brand visible, whereas setting itoff
conceals it, focusing solely on technical specs like clock speed and core count.
Example Output (CPU brand hidden):
OS: Ubuntu 22.04 LTS x86_64
Kernel: 5.11.0-40-generic
Uptime: 3 days, 4 hours, 20 mins
Packages: 1825 (dpkg)
Shell: bash 5.1.8
Resolution: 1920x1080
DE: GNOME 3.36.8
WM: Mutter
Theme: Yaru-dark [GTK2/3]
Icons: Yaru [GTK2/3]
Terminal: gnome-terminal
CPU: 3600 (12) @ 3.600GHz
GPU: NVIDIA GeForce GTX 1650
RAM: 16GB
Conclusion
Neofetch is a powerful and flexible tool to display system information in the terminal. With simple commands and toggles, users can tailor the output to show only the desired details, ensuring privacy or emphasizing specific system aspects. Whether you’re sharing specs online or organizing your workstation information, Neofetch offers the adaptability and comprehensive insights many tech enthusiasts and professionals seek.