How to use the command neofetch (with examples)

How to use the command neofetch (with examples)

Neofetch is a command-line tool that displays information about your operating system, software, and hardware. It provides a simple and convenient way to view system information in a beautiful ASCII art format. Whether you want to quickly check your system specifications or show off your Linux setup, Neofetch can be a useful tool to have.

Use case 1: Return the default config, and create it if it’s the first time the program runs.

Code:

neofetch

Motivation: Retrieving the default config is useful when you want to see how Neofetch is configured by default or if you want to compare your current configuration with the default settings. If this is the first time you are running Neofetch, the command will also create the default config file for you.

Explanation: The command neofetch is used to display system information. By simply running neofetch without any arguments, you will get an ASCII art representation of your system information along with the default configuration.

Example output:

         _,met$$$$$gg.           user@hostname
      ,g$$$$$$$$$$$$$$$P.        ------------
    ,g$$P"     """Y$$.".          OS: Ubuntu 20.04.1 LTS x86_64
   ,$$P'              `$$$.       Kernel: 5.4.0-54-generic
  ',$$P       ,ggs.     `$$b:     Uptime: 5 days, 10 hours, 25 minutes
  `d$$'     ,$P"'   .    $$$      Packages: 2368 (dpkg)
   $$P      d$'     ,    $$P      Shell: bash 5.0.17
   $$:      $$.   -    ,d$$'      Resolution: 1920x1080
   $$\;      Y$b._   _,d$P'        DE: GNOME
   Y$$.    `.`"Y$$$$P"'           WM: Mutter
   `$$b       "-.__              WM Theme: Adwaita
    `Y$$                          Theme: Yaru-dark [GTK2/3]
     `Y$$.            ."''"'.     Icons: Yaru [GTK2/3]
       `$$b._        ,'       _$.
          `"""`$$$$$$P'          Terminal: gnome-terminal
              PPPP                Terminal Font: Monospace 12

Use case 2: Trigger an info line from appearing in the output.

Code:

neofetch --enable infoname

Motivation: The --enable argument allows you to selectively enable certain information lines in the Neofetch output. This can be useful if you only want to display specific information and hide others.

Explanation: The command neofetch --enable infoname enables the information line specified by infoname. infoname is a placeholder for the actual function name in the Neofetch configuration file. For example, if you want to enable the memory information line, you would use neofetch --enable memory.

Example output:

         _,met$$$$$gg.           user@hostname
      ,g$$$$$$$$$$$$$$$P.        ------------
    ,g$$P"     """Y$$.".          OS: Ubuntu 20.04.1 LTS x86_64
   ,$$P'              `$$$.       Kernel: 5.4.0-54-generic
  ',$$P       ,ggs.     `$$b:     Uptime: 5 days, 10 hours, 25 minutes
  `d$$'     ,$P"'   .    $$$      Packages: 2368 (dpkg)
   $$P      d$'     ,    $$P      Shell: bash 5.0.17
   $$:      $$.   -    ,d$$'      Resolution: 1920x1080
   $$\;      Y$b._   _,d$P'        DE: GNOME
   Y$$.    `.`"Y$$$$P"'           WM: Mutter
   `$$b       "-.__              WM Theme: Adwaita
    `Y$$                          Theme: Yaru-dark [GTK2/3]
     `Y$$.            ."''"'.     Icons: Yaru [GTK2/3]
       `$$b._        ,'       _$.
          `"""`$$$$$$P'          Terminal: gnome-terminal
              PPPP                Terminal Font: Monospace 12

Use case 3: Hide/Show OS architecture.

Code:

neofetch --os_arch on

Motivation: If you don’t want to display the OS architecture information, you can hide it using the --os_arch argument. This can be useful if you prefer a cleaner and more minimalistic system information display.

Explanation: The --os_arch argument allows you to enable or disable the display of the OS architecture in the output. By using neofetch --os_arch on, you enable the display of the OS architecture.

Example output:

         _,met$$$$$gg.           user@hostname
      ,g$$$$$$$$$$$$$$$P.        ------------
    ,g$$P"     """Y$$."           OS: Ubuntu 20.04.1 LTS
   ,$$P'              `$$$.       Kernel: 5.4.0-54-generic
  ',$$P       ,ggs.     `$$b:     Uptime: 5 days, 10 hours, 25 minutes
  `d$$'     ,$P"'   .    $$$      Packages: 2368 (dpkg)
   $$P      d$'     ,    $$P      Shell: bash 5.0.17
   $$:      $$.   -    ,d$$'      Resolution: 1920x1080
   $$\;      Y$b._   _,d$P'        DE: GNOME
   Y$$.    `.`"Y$$$$P"'           WM: Mutter
   `$$b       "-.__              WM Theme: Adwaita
    `Y$$                          Theme: Yaru-dark [GTK2/3]
     `Y$$.            ."''"'.     Icons: Yaru [GTK2/3]
       `$$b._        ,'       _$.
          `"""`$$$$$$P'          Terminal: gnome-terminal
              PPPP                Terminal Font: Monospace 12

Use case 4: Enable/Disable CPU brand in output.

Code:

neofetch --cpu_brand off

Motivation: Neofetch displays the CPU brand by default. However, if you prefer not to show this information, you can disable it using the --cpu_brand argument. This can be useful if you want to hide sensitive information or if you simply prefer a cleaner system information display.

Explanation: The --cpu_brand argument allows you to enable or disable the display of the CPU brand in the output. By using neofetch --cpu_brand off, you disable the display of the CPU brand.

Example output:

         _,met$$$$$gg.           user@hostname
      ,g$$$$$$$$$$$$$$$P.        ------------
    ,g$$P"     """Y$$.".          OS: Ubuntu 20.04.1 LTS x86_64
   ,$$P'              `$$$.       Kernel: 5.4.0-54-generic
  ',$$P       ,ggs.     `$$b:     Uptime: 5 days, 10 hours, 25 minutes
  `d$$'     ,$P"'   .    $$$      Packages: 2368 (dpkg)
   $$P      d$'     ,    $$P      Shell: bash 5.0.17
   $$:      $$.   -    ,d$$'      Resolution: 1920x1080
   $$\;      Y$b._   _,d$P'        DE: GNOME
   Y$$.    `.`"Y$$$$P"'           WM: Mutter
   `$$b       "-.__              WM Theme: Adwaita
    `Y$$                          Theme: Yaru-dark [GTK2/3]
     `Y$$.            ."''"'.     Icons: Yaru [GTK2/3]
       `$$b._        ,'       _$.
          `"""`$$$$$$P'          Terminal: gnome-terminal
              PPPP                Terminal Font: Monospace 12

Conclusion:

In this article, we explored different use cases of the neofetch command. We learned how to retrieve the default config, enable or disable specific information lines, hide or show the OS architecture, and enable or disable the display of the CPU brand. With these use cases, you can customize the system information output according to your preferences and needs. Neofetch provides a visually appealing and informative way to display system information in the command line.

Related Posts

How to use the command pnmtofiasco (with examples)

How to use the command pnmtofiasco (with examples)

PNMTOFIASCO is a command-line tool that allows users to convert a Portable Anymap (PNM) image to a compressed FIASCO file format.

Read More
How to use the command 'gulp' (with examples)

How to use the command 'gulp' (with examples)

Gulp is a JavaScript task runner and streaming build system used for automating repetitive tasks in web development.

Read More
How to use the command `systemd-sysext` (with examples)

How to use the command `systemd-sysext` (with examples)

The systemd-sysext command is used to activate or deactivate system extension images.

Read More