Introduction:
This bash script monitors resource usage (CPU and Memory) of running processes, helping you identify high resource consumers.
Code Snippet:
Instructions:
Make the script executable and run it from the terminal:
Example Output:
This bash script monitors resource usage (CPU and Memory) of running processes, helping you identify high resource consumers.
Code Snippet:
Bash:
#!/bin/bash
# Process Resource Monitor
ps -eo pid,comm,%cpu,%mem --sort=-%cpu | head
Instructions:
Make the script executable and run it from the terminal:
Code:
chmod +x process_monitor.sh
./process_monitor.sh
Example Output:
Code:
PID COMMAND %CPU %MEM
1234 firefox 15.0 3.2
2345 chrome 10.5 2.8