File size: 547 Bytes
a89f25d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/bin/bash
# Bash Example: System Information
echo "=== System Information ==="
echo

# Display basic system info
echo "Hostname: $(hostname)"
echo "Current user: $(whoami)"
echo "Current directory: $(pwd)"
echo "Current time: $(date)"
echo

# Display system resources
echo "Memory usage:"
free -h
echo

echo "Disk usage:"
df -h / | tail -1
echo

# Display OS information
echo "Operating System:"
cat /etc/os-release | grep PRETTY_NAME
echo

# Process information
echo "Number of running processes: $(ps aux | wc -l)"
echo "Current shell: $SHELL"