Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- t="$(uptime | awk -F'( |,|:)+' '{
- d=h=m=0;
- if ($7=="min")
- m=$6;
- else {
- if ($7~/^day/) { d=$6; h=$8; m=$9}
- else {h=$6;m=$7}
- }
- }
- {
- print d*24+h+0,":",m+0
- }' | sed 's/ //g')"
- t1="$(uptime | sed 's/ up.*/ up/')"
- uptime | sed 's/users/user/' | sed "s/^[^,]*,*/${t1} ${t},/" | sed -e 's/^[ \t]*//'
- # uptime line1
- grep 'cpu' /proc/stat
- # greps every line with cpu in it from /proc/stat
- ps -eo %mem,%cpu,pid,comm,args --sort=-%mem | head -7 | tail -6 | sed -e 's/^[ \t]*//'
- #gets the 6 processes that use the most memory
- free -m | sed -n '1p;2p;4p' | sed 's/buffers/buff\/cache/'
- #provides information about the phycical and virtual memory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement