The program automatically uploads data to stdout. Looking for a way to write teams without flooding

The program resets to stdout, and while I try to enter new commands, I cannot see what I am writing because it is generated along with the output. Is there a shell that separates commands and exits? Or can I use two shells in which I can run commands on one and dump it to output the other?

+3
source share
3 answers

You can redirect program output to another terminal window. For instance:

program > /dev/pts/2 &

The style of the terminal name may depend on how your system is organized.

+3
source

"", , "tee", , stdout, .

$ yourapp | more    // show in page-sized chunks
$ yourapp | tee output.txt  // flood to stdout, but also save a copy in output.txt

$ yourapp | tee output.txt | more   // pageinate + save copy
+3

Or redirect standard output and error when starting the program, so this does not bother you:

./myprog >myprog.out 2>&1

or, alternatively, start another terminal to do your job. This leaves your program free to display what she likes on her terminal without bothering you.

Having said that, I will still capture information from the program into a file if you need to go back and look at it.

+3
source

Source: https://habr.com/ru/post/1788399/


All Articles