go linux 命令执行问题

5kill · 2017-07-25 06:17:41 · 2262 次点击

cmd := exec.Command("/bin/bash","-c","top -bn2")
top 命令 -b 批处理 n 循环显示次数

#5
更多评论

history 不是一个 linux 命令,而是 bash 内部的一个命令吧。top 因为是交互式的?

#1

对,所以要执行 history这样 内部命令 不能用这样方式么? top 确实是动态的 有木有linux 命令的操作方式呢。

#2