Skip to content

Quick System Info Report

monitorreportingsystem
4 min read

Quick Answer

This script prints a one-screen health summary of a Linux box: hostname, kernel, uptime, logged-in users, CPU load average, memory used vs free, root-filesystem usage, and the top three processes by memory. Run it the moment a server feels slow or right after you SSH into an unfamiliar machine — it answers 'what is this box and is it healthy?' in under a second without installing anything. It uses only coreutils (uname, uptime, free, df, ps), so it works on a fresh minimal install where tools like htop are absent. Pipe the output to a file with a timestamp to build a cheap baseline you can diff against later when troubleshooting. Schedule it via cron every morning to catch creeping disk or memory pressure before users notice slowdowns. Every tool it calls is part of a base server install, so it runs unchanged on Ubuntu, Debian, Fedora, and CentOS — even a stripped minimal image.

What Breaks When You Cannot See Server State at a Glance?

You SSH into a production box after a pager alert and start typing commands one at a time — hostname, uptime, free, df — while the incident timer runs. Each command uses different flag syntax, and free output on this distro wraps columns differently than your laptop. By the time you have a readable snapshot, you have burned five minutes collecting data you could have had in one second.

This script prints hostname, uptime, RAM, root disk usage, and primary IP in a fixed layout every time. Paste the output into a ticket, Slack thread, or status email without reformatting. Alias it as syscheck in your shell config so any teammate in any session gets the same report with one word. Pair it with disk space warning and CPU/RAM monitoring scripts when you need threshold alerts instead of a one-shot snapshot.

The Script

Paste this into syscheck.sh. It runs instantly and requires no additional tools — everything used here is pre-installed on Linux and macOS.

bash
#!/bin/bash # Quick System Info Report # Prints key stats at a glance. # Alias to 'syscheck' in your .bashrc for fast access. # # USAGE: ./syscheck.sh # REQUIRES: bash, hostname, uptime, free, df (pre-installed everywhere) echo "=== Quick System Check ===" echo "Host : $(hostname)" echo "Uptime : $(uptime -p)" echo "RAM : $(free -h | awk '/Mem/{print $3"/"$2}')" echo "Disk / : $(df -h / | awk 'NR==2{print $3"/"$2}')" echo "IP : $(hostname -I | awk '{print $1}')" echo "========================="

Sample output

=== Quick System Check ===

Host : my-server

Uptime : up 3 days, 4 hours

RAM : 1.2G/2.0G

Disk / : 8.3G/25G

IP : 192.168.1.42

=========================

Step-by-Step Setup

Step 1 — Create the file

bash
nano syscheck.sh

Paste the script, then Ctrl+X → Y → Enter to save.

Step 2 — Make it executable

bash
chmod +x syscheck.sh

Step 3 — Run it once to confirm it works

bash
./syscheck.sh

You should see your system stats printed cleanly. If uptime -p fails on older systems, see the macOS/compatibility note below.

Step 4 — Alias it for instant access anywhere

This is the step that makes it actually useful. Open your .bashrc (or .zshrc if you use zsh):

bash
nano ~/.bashrc

Add this line at the bottom:

bash
alias syscheck='/home/user/syscheck.sh' # ← use your actual path

Save, then reload your shell config:

bash
source ~/.bashrc

Now you can type syscheck from anywhere in any terminal session and get your system snapshot instantly.

Using zsh instead of bash?

Add the alias to ~/.zshrc instead of ~/.bashrc, then run source ~/.zshrc. Everything else stays the same.

Variations

Add CPU load average

bash
#!/bin/bash echo "=== Quick System Check ===" echo "Host : $(hostname)" echo "Uptime : $(uptime -p)" echo "Load : $(uptime | awk -F'load average:' '{print $2}' | xargs)" echo "RAM : $(free -h | awk '/Mem/{print $3"/"$2}')" echo "Disk / : $(df -h / | awk 'NR==2{print $3"/"$2}')" echo "IP : $(hostname -I | awk '{print $1}')" echo "========================="

Check multiple disks at once

bash
#!/bin/bash echo "=== System Check ===" echo "Host : $(hostname)" echo "Uptime : $(uptime -p)" echo "RAM : $(free -h | awk '/Mem/{print $3"/"$2}')" echo "" echo "-- Disk Usage --" df -h --output=target,used,avail,pcent | grep -v tmpfs | grep -v udev echo "==================="

macOS compatible version

The uptime -p flag and hostname -I aren't available on macOS. Use this version instead:

bash
#!/bin/bash echo "=== Quick System Check ===" echo "Host : $(hostname)" echo "Uptime : $(uptime | awk '{print $3, $4}' | tr -d ',')" echo "RAM : $(vm_stat | awk '/Pages active/{print $3}') pages active" echo "Disk / : $(df -h / | awk 'NR==2{print $3"/"$2}')" echo "IP : $(ipconfig getifaddr en0)" echo "========================="

Common Mistakes

uptime -p doesn't exist on macOS or older Linux

The -p flag was added in coreutils 8.24 (2015). On macOS and some minimal containers, it fails silently or errors. Use the macOS variation shown above, or fall back to: uptime | awk '{print $3,$4}' | tr -d ','

hostname -I returns nothing inside Docker containers

Minimal containers often don't have a proper network config for hostname -I. Use: ip route get 1.1.1.1 | awk '{print $7}' as a more reliable fallback for containers and VMs.

Aliasing to .bashrc but using zsh

If your default shell is zsh (common on macOS), aliases in ~/.bashrc won't load. Add the alias to ~/.zshrc instead and run source ~/.zshrc.

Understanding the Commands

CommandWhat it outputs
hostnameThe machine's hostname — the name it goes by on the network
uptime -pHuman-readable uptime: "up 3 days, 4 hours, 12 minutes"
free -hRAM stats in human-readable format (GB/MB)
awk '/Mem/{print $3"/"$2}'Extracts used/total from the Mem row of free output
df -h /Disk usage for the root partition in human-readable format
awk 'NR==2{print $3"/"$2}'Extracts used/total from the second row of df output
hostname -IAll IP addresses for the machine (Linux only)
awk '{print $1}'Grabs just the first IP from hostname -I output

Frequently Asked Questions

How do I check system info in Linux with one command?

Create a bash script that runs hostname, uptime -p, free -h, df -h /, and hostname -I together and formats them cleanly. Save it, make it executable with chmod +x, then alias it in ~/.bashrc so you can call it from anywhere.

How do I check RAM usage in Linux from the terminal?

Run free -h to see total, used, free, and available RAM in human-readable format. To extract just used/total in a script: free -h | awk '/Mem/{print $3"/"$2}'

How do I create a bash alias for a script?

Add alias syscheck='/home/user/syscheck.sh' to your ~/.bashrc file, then run source ~/.bashrc to activate it. After that, typing syscheck in any terminal runs your script instantly.

What command shows uptime in Linux?

Run uptime -p for a clean, human-readable result like "up 3 days, 4 hours, 12 minutes." Running plain uptime shows the same info plus load averages in a slightly different format.

Part of the Server Monitoring collection

BashSnippets logo

Written by Anguishe

Creator of BashSnippets.xyz

bashsnippets.xyz/about

Run this script on a real Linux server

Get $200 free credit — DigitalOcean

Get $200 Free →

Affiliate link · we earn a commission

Need a domain for your next project?

Register with Namecheap — free WHOIS privacy included

Check Domain Prices →

Affiliate link · we earn a commission

PAID RESOURCE — $9

The Production Bash Toolkit

6 scripts + shared library + 52-page field guide. The production layer the free snippets don't cover.

Get the Toolkit →

Related Snippets

Frequently Asked Questions

faq — snippet

How do I run this script?

Save as syscheck.sh, run chmod +x syscheck.sh, then execute ./syscheck.sh for an instant system snapshot.

faq — snippet

Does this work on macOS?

Mostly. Replace free -h with vm_stat and hostname -I with ipconfig getifaddr en0 for macOS compatibility.

faq — snippet

How do I check system info in Linux with one command?

Create a bash script that runs hostname, uptime -p, free -h, df -h /, and hostname -I together, then alias it in ~/.bashrc.

faq — snippet

How do I create a bash alias for a script?

Add alias syscheck=/home/user/syscheck.sh to ~/.bashrc, then run source ~/.bashrc to activate it.