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
Not the answer you're looking for? Browse other questions tagged linux bash shell or ask your own question.
asked |
7 years ago |
viewed |
57651 times |
active |
Linked
Related
Hot Network Questions
- Explain voltage readings on NEMA 10-30 socket
- Is Helvetica considered a "web safe" font?
- Why does Uncle Bob suggest that coding standards shouldn't be written down if you can avoid it?
- Why was the audio output of the SID6581 so variable between chips?
- Is it possible to attach generated doc string to a lambda?
- From an IQ exam: What does this say?
- Is using an outdated C compiler a security risk?
- Why is the simple harmonic motion idealization inaccurate?
- What was the reason for Deadpool always forgetting these items?
- Calculating the amount of cubes needed to form a sum
- Word for an inaccurate work by an artist, who ineptly misrepresented their subject?
- Do Gödel numbers have a practical use?
- First appearance of the "wake up from a coma, discover the world has ended" trope?
- Would a culture with magic consider it magic?
- what triggers Google's reCaptcha
- LED still on when turned off
- The fastest С++ algorithm for string testing against a list of predefined seeds (case insensitive)
- tikzlibrary chains misbehaving
- I did PCA of my dataset with two classes and here is the scatterplot; how can I tell if my dataset is learnable?
- Why would the richest and strongest country on Earth consistently fail at Big Projects?
- Recreate new car smell
- Elemental Healing
- Which game is this (RPG)?
- Why is the temperature range of industrial and military products so high?
Technology | Life / Arts | Culture / Recreation | Science | Other | ||
---|---|---|---|---|---|---|