Linux Commands for System Information

And by “juicy”, I mean things like how many CPUs it has, how much RAM is installed, and which version of the operating system you’re running.
Now, let me give you an example to make this a little clearer: say you want to know how much memory (RAM) your computer has. Well, in Linux, there’s a handy-dandy command called “free” that can do just that! Here’s what it looks like when you run it:


# This script uses the "free" command to display the memory usage of a Linux operating system.

# The "-h" flag is used to display the memory values in a human-readable format.

# The "total" column shows the total amount of memory available on the system.

# The "used" column shows the amount of memory currently being used by the system.

# The "free" column shows the amount of memory that is currently available for use.

# The "shared" column shows the amount of memory being shared between processes.

# The "buff/cache" column shows the amount of memory being used for buffering and caching data.

# The "available" column shows the amount of memory that is available for use by applications.

# The "Mem" section displays information about physical memory (RAM).

# The "Swap" section displays information about swap space, which is used as virtual memory when physical memory is full.

So, according to this output, my computer has a total of 15 gigabytes (Gi) of memory installed. Of that, about 6.3 Gi is currently being used by various programs and processes, while another 4.2 Gi is sitting around waiting for something to do. The “shared” column shows how much memory is being shared between different applications, which can be useful if you’re running low on resources. And finally, the “buff/cache” column tells us how much of that available memory is currently being used as a buffer or cache by the operating system and other programs.
Now, let me give you another example: say you want to know what version of Linux your computer is running. Well, in this case, there’s an even simpler command called “lsb_release” that can do just that! Here’s what it looks like when you run it:


# This script uses the "lsb_release" command to display information about the Linux operating system.

# The "-a" flag is used to display all available information.

lsb_release -a

# The following line indicates that no LSB (Linux Standard Base) modules are available.

No LSB modules are available.

# The "Distributor ID" line displays the name of the Linux distribution, in this case, Ubuntu.

Distributor ID: Ubuntu

# The "Description" line provides a brief description of the distribution, including the version number and LTS (Long Term Support) status.

Description:    Ubuntu 20.04.3 LTS

# The "Release" line displays the specific version of the distribution, in this case, 20.04.

Release:        20.04

# The "Codename" line displays the code name for the distribution, in this case, focal.

Codename:   focal

So, according to this output, my computer is running the latest version of Ubuntu (as of August 2021), which is called “Focal Fossa”. The “Distributor ID” tells us that we’re using an official release of Ubuntu, while the “Description” and “Release” columns give us more specific details about what version we’re running. And finally, the “Codename” column is just a fun little name for this particular release of Ubuntu (which happens to be named after a type of seal).

These are just two examples of the many cool tools and commands available in Linux that can help you gather information about your system. Whether you’re trying to figure out how much memory or CPU power you have, or what version of Linux is installed on your computer, these commands (and others like them) can provide all sorts of useful insights into the inner workings of your machine. And best of all, they’re easy to use and understand!

SICORPS