Master your Linux skills with this one-command Bash script to display full Linux system information in seconds! 🚀
In this tutorial, I’ll walk you step-by-step through creating a simple yet powerful script to check OS version, kernel, CPU architecture, disk usage, RAM usage, logged-in users, and open ports — all in one command. Perfect for system administrators, DevOps engineers, and anyone preparing for Linux certification exams like LPIC-1, LFCS, or RHCSA.
Whether you're working on Ubuntu, CentOS, or any Linux distro, this script will save you time and make system monitoring effortless.
📌 Topics Covered:
00:00 – Introduction to the one-command Bash script for full Linux system info
00:01 – Creating system-info.sh script file in a text editor
00:02 – Getting OS name from /etc/os-release file
00:03 – Displaying Linux distribution (e.g., Ubuntu)
00:04 – Using uname -r to check current kernel version
00:05 – Checking system architecture
00:06 – Getting root partition disk capacity
00:07 – Displaying current RAM usage and available memory
00:08 – Memory usage details with free -h
00:09 – Listing currently logged-in users
00:10 – Checking open ports for running services
00:11 – Viewing port, protocol, and IP address information
00:12 – Making the script executable with chmod
00:13 – Running the Bash script to display full system info
Bash script:
Display the currently logged-in user
echo "Current User: $(whoami)"
Display the operating system name and version
echo "Operating System: $(cat /etc/os-release | grep '^PRETTY_NAME=' | cut -d '=' -f2 | tr -d '\"')"
Display the system uptime
echo "System Uptime: $(uptime -p)"
Display the kernel version
echo "Kernel Version: $(uname -r)"
Display the system architecture
echo "Architecture: $(uname -m)"
Display the IP address of the system
echo "IP Address: $(hostname -I | awk '{print $1}')"
Display the total disk space, used space, and available space
echo "Disk Space Information:"
df -h / | awk 'NR==2 {print "Total Size: " $2 ", Used: " $3 ", Available: " $4}'
Display the total memory, used memory, and available memory
echo "Memory Information:"
free -h | awk 'NR==2 {print "Total: " $2 ", Used: " $3 ", Available: " $4}'
Display information about the CPU model
echo "CPU Information: $(lscpu | grep 'Model name:' | sed 's/Model name:[ \t]*//')"
Display a list of users currently logged into the system
echo "Logged-in Users:"
who
echo "Listening Ports:"
ss -tuln | awk '$2 == "LISTEN" {print $1, $2, $4, $5}'
End of the script
echo "====================================="
echo " End of System Information "
echo "====================================="
🔑 Keywords :
#linux commands#bash script tutorial#linux system info#linux admin tips#check os version linux#check kernel linux#linux memory usage#linux disk usage#linux network ports #bash scripting for beginners#linux for sysadmin#linux devops#system monitoring linux#ubuntu server tutorial#centos admin guide#linux shell script example#linux terminal commands#linux certification training#lpic-1 #practice#rhcsa preparation
📚 Free Resources & Related Videos:
One Command Bash Script to Display Full Linux System Info: https://luuhophuong.com/huong-dan-vie...