且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

附加到进程输出以供查看

更新时间:2023-12-03 22:27:16

这里有几个选项.一种是将命令的输出重定向到一个文件,然后使用tail"实时查看添加到该文件中的新行.

There are a few options here. One is to redirect the output of the command to a file, and then use 'tail' to view new lines that are added to that file in real time.

另一种选择是在屏幕"内启动您的程序,这是一种基于文本的终端应用程序.屏幕会话可以附加和分离,但名义上只能由同一用户使用,因此如果您想在用户之间共享它们,那就太麻烦了.

Another option is to launch your program inside of 'screen', which is a sort-of text-based Terminal application. Screen sessions can be attached and detached, but are nominally meant only to be used by the same user, so if you want to share them between users, it's a big pain in the ass.