答え1
そしてawk
:
$ top -bn2 | awk '/^%Cpu/ && n++ {print $2}'
85.7
答え2
代替方法:
┌─[root@Fedora]─[~]─[03:43 pm]
└─[$]› top -bn 2 | grep Cpu | tail -1 | awk '{print $2}'
0.6
そしてawk
:
$ top -bn2 | awk '/^%Cpu/ && n++ {print $2}'
85.7
代替方法:
┌─[root@Fedora]─[~]─[03:43 pm]
└─[$]› top -bn 2 | grep Cpu | tail -1 | awk '{print $2}'
0.6