-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsysinfo.sh
More file actions
executable file
·41 lines (30 loc) · 1.08 KB
/
sysinfo.sh
File metadata and controls
executable file
·41 lines (30 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Linux System Info Script (with Colors)
# Define colors
GREEN="\e[32m"
YELLOW="\e[33m"
CYAN="\e[36m"
RED="\e[31m"
RESET="\e[0m"
echo -e "${CYAN}----------------------------------${RESET}"
echo -e " 🐧 ${YELLOW}Linux System Information${RESET}"
echo -e "${CYAN}----------------------------------${RESET}"
# Show hostname
echo -e "${GREEN}Hostname:${RESET} $(hostname)"
# Show uptime
echo -e "${GREEN}Uptime:${RESET} $(uptime -p)"
# Show current date & time
echo -e "${GREEN}Date & Time:${RESET} $(date)"
# Show system load
echo -e "${GREEN}System Load:${RESET} $(uptime | awk -F'load average:' '{ print $2 }')"
# Show memory usage
echo -e "${GREEN}Memory Usage:${RESET}"
free -h | awk '/Mem:/ {print " Used: " $3 " / " $2}'
# Show disk usage
echo -e "${GREEN}Disk Usage:${RESET}"
df -h --total | grep 'total' | awk '{print " Used: " $3 " / " $2 " (" $5 " used)"}'
# Show logged in users
echo -e "${GREEN}Logged in Users:${RESET}"
who | awk '{print " " $1 " - " $5}'
echo -e "${CYAN}----------------------------------${RESET}"
echo -e " Script ${YELLOW}Completed ✅${RESET}"