Monday, February 28, 2011

Monitor CPU and memory

user@user-VirtualBox:~/work$ top -b -n1 | grep top
top - 06:30:49 up 4 min,  2 users,  load average: 1.17, 1.03, 0.47
Tasks: 176 total,   1 running, 175 sleeping,   0 stopped,   0 zombie
 1738 user      20   0  2620 1112  816 R  0.0  0.2   0:00.02 top



user@user-VirtualBox:~/work$ top -b -n1 | grep top | cut -f 9 -d ','


Results
 1740 user      20   0  2620 1112  816 R  0.0  0.2   0:00.02 top 



user@user-VirtualBox:~/work$ top -b -n1 | grep top | cut -f 9 -d ',' | cut -f 2,3,14,15,17,20 -d ' '
Results
PID    user VIRT RES  SHR   CPU
1783 user 2620  1096  840    1.9

No comments:

Post a Comment