Engineer/Linux
[linux] CPU usage
mjune.kim
2017. 7. 12. 19:45
#!/bin/sh
while true; do
( echo "%CPU MEM ARGS $(date)" &x%x ps -e -o pcpu,pmem,args --sort=pcpu | cut -d" " -f1-5 | tail) >> ps.log; sleep 5;
done
while true; do
( echo "%CPU MEM ARGS $(date)" &x%x ps -e -o pcpu,pmem,args --sort=pcpu | cut -d" " -f1-5 | tail) >> ps.log; sleep 5;
done