Skip to content

Commit d8097f9

Browse files
committed
Deleted public/consolidated/ and put code into a function
1 parent fd5a1ca commit d8097f9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

snippets/bash/system/system-resource-monitor.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ tags: file,system
66
---
77

88
```bash
9+
system_resources () {
910
echo "CPU Load: $(top -bn1 | grep "Cpu(s)" | awk '{print $2}')%"
1011
echo "Memory Used: $(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2}')"
1112
echo "Disk Used: $(df -h / | awk 'NR==2{print $5}')"
1213
echo "Active Users: $(who | wc -l)"
14+
}
15+
16+
system_resources "$@"
1317

1418
// Usage:
1519
chmod a+x system-resource-monitor.sh // First make it executable for all the users

0 commit comments

Comments
 (0)