10 lines
264 B
Bash
10 lines
264 B
Bash
#!/bin/bash
|
|
# This script monitors CPU and memory usage
|
|
|
|
# Get the current usage of CPU and memory
|
|
cpuUsage=$(top -bn1 | awk '/Cpu/ { print $2}')
|
|
memUsage=$(free -m | awk '/Mem/{print $3}')
|
|
|
|
# Print the usage
|
|
echo "CPU : $cpuUsage% - RAM : $memUsage MB"
|