附加到进程输出以供查看 [英] Attach to a processes output for viewing

查看:36
本文介绍了附加到进程输出以供查看的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将控制台/终端视图附加"到应用程序输出,以便我可以看到它可能在说什么?

How would I 'attach' a console/terminal-view to an applications output so I can see what it may be saying?

如何在不终止应用程序的情况下从应用程序输出中分离?

How would I detach from an applications output without killing the application?

通常,如果您使用命令行启动健谈的应用程序,您会看到各种精彩的输出.然而,假设我有一个特别健谈的程序在运行,比如 KINO,我想在任何给定时刻查看它的输出,而无需通过命令行重新启动它.我不能;至少我不知道怎么做.

Normally if you fire up a talkative application using the command line you get to see all kinds of wonderful output. However, let’s say I have a particularly chatty programming running, like KINO, and I want to view its output at any given moment without restarting it through the command line. I cannot; at least I don't know how.

推荐答案

这里有几个选项.一种是将命令的输出重定向到一个文件,然后使用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.

这篇关于附加到进程输出以供查看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆