Score:1

empty terminal with multi lines

de flag

I have problem with terminal .. I run a command but it took a time to be finish and it printed a lot of lines in terminal but when I came back to first line by mouse I got blank and empty screen .. How can I make terminal save the lines exist ?

Score:0
in flag

There might be some bugs with your terminal emulator (gnome-terminal I assume), but if your goal is to read that data, you don't need to rely on terminal's scroll. You could always try a different terminal emulator, but all you need is to do something with that text.

  1. We can redirect that stream of data to a file (&> instead of > will capture even error output):

    my_command_with_long_output > /path/to/file
    

    Then read it with some text editor of choice.

  2. You can also redirect it directly to a pager like less:

    my_command_with_long_output | less
    

    and use less's scrolling (j/k, Ctrl+d/u).

The point is that the terminal emulator doesn't even need to be able to scroll for you to see long output.

user avatar
de flag
thanks a lot for replying but what if i want to see the first line during run ?
in flag
There are so many options how to answer this, but I would suggest trying `tee` command. You would use it like `my_command | tee /path/to/file` and it basically redirects output to said file **as well as outputs it to stdout for you to read instantly**. You could combine it with more tools, Maybe you wanted to store it as whole for you to read with editor, but only see first line during run: `my_command | tee /path/to/file | head -n 1`.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.