-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem-info.sh
More file actions
executable file
·69 lines (51 loc) · 1.23 KB
/
system-info.sh
File metadata and controls
executable file
·69 lines (51 loc) · 1.23 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
#############################################################################
# Collects and displays key system information.
#
# Author: Arief
# Version: v0.0.1
#
# Usage:
# ./system_info.sh
#
# Description:
# Displays hostname, OS type, kernel version, uptime, users, memory,
# CPU info, network interfaces, and disk usage.
#
# Notes:
# - Requires standard Linux utilities: lscpu, free, ip, df, etc.
#############################################################################
# Debug Mode
#set -x
set -euo pipefail
print_divider() {
echo "-------------------------------------------------------------------"
}
echo "================================System Info================================"
hostname=$(hostname)
echo " Hostname: $hostname"
print_divider
os=$(uname -o)
echo " OS Type: $os "
print_divider
kernel=$(uname -r)
echo " Kernel Version: $kernel "
print_divider
uptime=$(uptime -p)
echo " Pretty uptime: $uptime "
print_divider
echo " Logged-in-users: "
who
print_divider
echo " Memory Info: "
free -h
print_divider
echo " CPU Info: "
lscpu
print_divider
echo " Network Info: "
ip a
print_divider
echo " Disk Usage: "
df -h
echo "======================================================================="