帮帮我出出主意吧,实在没辙了top >a.txt 是乱码:
位高手们,帮帮我出出主意吧,实在没辙了top |col -b >a.txt 双击打开是乱码:谢谢大家
[H[2J(B[mtop - 15:04:47 up 49 min, 4 users, load average: 0.04, 0.83, 8.63(B[m[39;49m[K
Tasks:(B[m[39;49m(B[m 185 (B[m[39;49mtotal,(B[m[39;49m(B[m 1 (B[m[39;49mrunning,(B[m[39;49m(B[m 184 (B[m[39;49msleeping,(B[m[39;49m(B[m 0 (B[m[39;49mstopped,(B[m[39;49m(B[m 0 (B[m[39;49mzombie(B[m[39;49m[K
------解决方案--------------------top默认输出是带格式的吧
带格式的,bash可以把它解析成背景色之类的,但是如果在txt里就木有办法了
看看top的帮助,能不能把格式去掉吧
------解决方案--------------------
top -b -n 1
------解决方案--------------------2L的方法ok的
top -b -n 1 > a.txt