1

This question already has an answer here:

An application is already running without command output, only GUi.

How can I grab the application's command output from a new terminal window?

Another application is already running as CLi, but I would like to monitor that specific application from a different window or even remotely without affecting the application itself?

marked as duplicate by meuh, Anthony Geoghegan, Michael Homer, Tomasz, G-Man Jan 22 '18 at 6:44

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    Is it a type of application that generates log files? Do you only want to know how to do this when applications are already running, or is a case where you know beforehand alright as well? – Academiphile Jan 21 '18 at 4:45
2

This is very complicated for a running application. You need to attach a debugger, close the file descriptors 0, 1, and 2, open a new controllingf terminal and open the file descriptors accordingly. Probably not even this works if the app notices that it does not have a controlling terminal and thus does not use stdin, stdout, and stderr the usual way, maybe even has closed them and used them for different purposes.

Not the answer you're looking for? Browse other questions tagged or ask your own question.