LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How might I grep multiple live outputs? (https://www.linuxquestions.org/questions/linux-general-1/how-might-i-grep-multiple-live-outputs-4175486771/)

smalltock 12-03-2013 10:35 PM

How might I grep multiple live outputs?
 
I'm not the most experienced individual when it comes to Linux or its commands, but let's say I wanted to launch a program and run multiple expressions on its text output, all of which output to a live buffer. How might I do this and separate each expression's output to a separate buffer or separate terminal?

I could probably figure out how to output to separate files, but I want each filter updating in real-time and isolated (not cluttered by the other filters' outputs).
Also, is there any way I can remove a segment of text from the beginning of each line? I haven't looked into that at all yet.

descendant_command 12-03-2013 10:57 PM

You could dump the raw output to a logfile and run several 'tail -f's piped to appropriate greps or seds or awks or such.

smalltock 12-03-2013 11:23 PM

Thank you for the speedy response :)
That could work, but there's something else that I'd prefer to do if at all possible.
Am I able to pipe ALL output from one terminal into two others? And if so, could I have two different grep expressions running in each destination terminal? I'm using the terminator terminal, by the way, but if there is a universal solution, that'd be fantastic.

wstewart90 12-05-2013 12:04 AM

Yes, you can use tail -f from multiple terminals and use separate grep expressions on each one if you wanted to. Linux is too versatile to only have one solution.

smalltock 12-07-2013 07:43 AM

Yes! That's fantastic! Thank you very much :D


All times are GMT -5. The time now is 04:06 AM.