ThisCalculator

Everyday

System Information in Terminal: How to View It

Updated · Standard formula, shown below

To view system information in a terminal, you use command-line tools that report details about your hardware, operating system, kernel, and running processes. The exact command depends on your operating system—systeminfo on Windows, uname -a on Linux and macOS, and neofetch or inxi for a more readable summary on Linux. This article explains the most common commands, what each one shows, and how to interpret the output.

Why Use the Terminal for System Info?

Graphical system information tools (like Task Manager on Windows or System Information on macOS) are convenient, but the terminal offers several advantages:

  • Speed: A single command often shows more detail than clicking through multiple GUI windows.
  • Scriptability: You can capture the output to a file or pipe it into other commands for analysis.
  • Remote access: When you SSH into a server, the terminal is your only way to see system details.
  • Consistency: The same commands work across many Linux distributions, making it easier to support multiple machines.

For troubleshooting performance issues, checking kernel versions, or verifying hardware compatibility, the terminal is often the fastest route.

Linux and macOS: The Core Commands

Linux and macOS share a common Unix heritage, so many commands are identical. Here are the most useful ones:

  • uname -a – Shows the kernel name, hostname, kernel release, kernel version, machine hardware name, and operating system.
  • lscpu – Displays CPU architecture, cores, threads, model name, and cache sizes (Linux only).
  • free -h – Shows memory usage in a human-readable format (Linux; on macOS use vm_stat).
  • df -h – Lists disk space usage for mounted filesystems.
  • top or htop – Shows real-time process and resource usage.
  • lsblk – Lists block devices (hard drives, SSDs, partitions) in a tree view (Linux).

On macOS, you can also use system_profiler to get a detailed hardware and software report. For a quick overview, system_profiler SPHardwareDataType shows model, chip, memory, and serial number.

Windows: Using Command Prompt and PowerShell

Windows offers several terminal-based tools:

  • systeminfo – Shows OS version, manufacturer, memory, network info, and installed hotfixes. It can be slow because it queries a lot of data.
  • wmic (Windows Management Instrumentation Command) – Deprecated in newer Windows versions but still works. Example: wmic cpu get name shows the CPU name.
  • Get-ComputerInfo (PowerShell) – A more modern and comprehensive cmdlet that returns a large object with system, OS, and hardware properties.
  • ver – Shows the Windows version number (e.g., Microsoft Windows [Version 10.0.19045.4412]).

In PowerShell, you can also use Get-CimInstance Win32_Processor to get CPU details, or Get-PhysicalDisk for disk health and size.

Getting a Pretty Summary: neofetch and inxi

If you want a visually appealing, one-screen summary, tools like neofetch and inxi are popular on Linux. They display the OS logo in ASCII art along with key info: OS name, kernel, uptime, shell, CPU, GPU, memory, and disk usage.

To install them on Debian/Ubuntu: sudo apt install neofetch or sudo apt install inxi. On Arch: sudo pacman -S neofetch. On macOS, you can install via Homebrew: brew install neofetch.

These tools are not preinstalled on most systems, so you need to install them first. They are read-only and safe to run.

How to Choose the Right Command

Choosing the right command depends on what you need to know:

  • Kernel/OS version: uname -a (Linux/macOS) or ver (Windows).
  • CPU details: lscpu (Linux), sysctl -n machdep.cpu.brand_string (macOS), or wmic cpu get name (Windows).
  • Memory usage: free -h (Linux), vm_stat (macOS), or Get-CimInstance Win32_OperatingSystem | Select FreePhysicalMemory (PowerShell).
  • Disk usage: df -h (Linux/macOS) or Get-PSDrive (PowerShell).
  • Full system overview: systeminfo (Windows), system_profiler (macOS), or neofetch (Linux).

For a quick, human-readable summary on any Unix-like system, uname -a is the first command to try.

Common Problems and Misconceptions

“Why does systeminfo take so long?” On Windows, systeminfo queries the entire system, including network adapters and installed hotfixes, which can take a minute or two. It’s normal.

“Why does free -h show less RAM than I have?” The kernel reserves some memory for itself and for hardware buffers. Also, on Linux, “available” memory is what matters, not “free.”

“Why does uname not show my distribution name?” uname shows the kernel, not the distribution. Use cat /etc/os-release on Linux to see the distro name and version.

“Is it safe to run these commands?” All the commands mentioned are read-only. They only query system information and do not modify anything. However, some tools like top or htop allow you to send signals to processes, so be careful not to press k and enter a PID accidentally.

Frequently Asked Questions

How do I see my IP address in the terminal?

On Linux, use ip addr or hostname -I. On macOS, use ifconfig | grep inet. On Windows, use ipconfig. These show both IPv4 and IPv6 addresses.

What is the difference between uname and lscpu?

uname shows the kernel and system architecture (e.g., x86_64), while lscpu provides detailed CPU information like model name, cores, threads, and cache sizes. They complement each other.

Can I get system info on a remote server?

Yes, if you have SSH access, you can run the same commands remotely. For example: ssh user@server uname -a. This is a common way to check server specs without physical access.

Why does neofetch not work on Windows?

neofetch is a Unix tool. On Windows, you can use PowerShell or install it via WSL (Windows Subsystem for Linux). Alternatively, use systeminfo or Get-ComputerInfo.

How do I save the output to a file?

Use redirection. For example: systeminfo > systeminfo.txt (Windows), or uname -a > systeminfo.txt (Linux/macOS). This creates a file containing the output.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.