如何直接在tty上运行像htop这样的交互式控制台程序?

时间:2018-03-11 20:46:08

标签: linux pipe tty

我确实在我的覆盆子pi上做了一个有趣的发现。如果我以root身份运行以下命令:

htop > /dev/tty0

然后htop的输出将直接打印在屏幕上(hdmi连接) 我想将htop作为服务运行,但是当我在系统脚本中执行此操作时,它会说

systemd error opening terminal unknown

如何解决? 我也试过了

cat /dev/null | htop > /dev/tty

同样的结果......

1 个答案:

答案 0 :(得分:0)

[Service]
StandardOutput=tty
<{1>}文件中的

。有关详细信息,请参阅.service