Jay Taylor's notes
back to listing indexRedirect STDERR / STDOUT of a process AFTER it's been started, using command line?
[web search]
In the shell you can do redirection, Here's how I came to ask this question, a program running in the background of my terminal keeps outputting annoying text. It's an important process so I have to open another shell to avoid the text. I'd like to be able to
|
|||||||||||||||
|
|||||||||||||||
Short of closing and reopening your tty (i.e. logging off and back on, which may also terminate some of your background processes in the process) you only have one choice left:
e.g.:
You may also consider:
|
|||||||||||||||||||||||||||||||||
|
This will do:
It's not that clean (shows lines like: You might also dislike the fact that arguments are abbreviated. To control that use the It catches all streams, so you might want to filter that somehow:
shows only descriptor 1 calls.
|
|||||||||||||||||||||
|
riffing off vladr's (and others') excellent research: create the following two files in the same directory, something in your path, say $HOME/bin: silence.gdb, containing (from vladr's answer):
and silence, containing:
Now, next time you forget to redirect firefox, for example, and your terminal starts getting cluttered with the inevitable "(firefox-bin:5117): Gdk-WARNING **: XID collision, trouble ahead" messages:
You could also redirect gdb's output to /dev/null if you don't want to see it.
|
|||||||||
|
Redirect output from a running process to another terminal, file or screen:
Inside gdb:
Detach a running process from bash terminal and keep it alive:
Explanation: 20818 - just an example of running process pid
|
|||||||||
|
Not a direct answer to your question, but it's a technique I've been finding useful over the last few days: Run the initial command using 'screen', and then detach.
|
|||
this is bash script part based on previous answers, which redirect log file during execution of an open process, it is used as postscript in
|
|||
Your Answer
asked |
7 years ago |
viewed |
57651 times |
active |
Technology | Life / Arts | Culture / Recreation | Science | Other | ||
---|---|---|---|---|---|---|