每当top通过 SSH 在 Linux 中远程执行命令时,我都会收到此错误:
top: Unknown terminal "dumb" in $TERM
Run Code Online (Sandbox Code Playgroud)
我监视远程机器性能的 Java 应用程序使用 top 命令的输出。
我该如何解决这个问题?
尝试将-b选项传递给 top。从手册中:
b Batch mode. Useful for sending output from top to other programs or to a file. In this mode, top will
not accept command line input. It runs until it produces the number of iterations requested with the n
option or until killed. Output is plain text suitable for display on a dumb terminal.
Run Code Online (Sandbox Code Playgroud)