0

If I have multiple log files open in several screens and I want to copy all useful traces to a single file, I initially copy them to the screen scrollback buffer file.

Doing ">" after selecting text will overwrite the buffer. How do I append selected text to the buffer file?

This question concerns screen commands in Linux.

1
  • Just as an added note: If this is about some specific program (screen or display could be pretty much anything; I assumed a console/terminal), then you should expand your question to make it more clear.
    – Mario
    Commented May 14, 2014 at 8:00

1 Answer 1

1

Basically you've got four related operators to redirect input/output:

  • > will redirect your output and remove existing content (if possible). For example, this will overwrite existing contents of a file, but it won't clear the console contents:

    command > mylog.log
    
  • >> will append your output to existing content, which is most likely the behavior you're looking for:

    command >> mylog.log
    
  • < will read some source and treat it as input (stdin):

    command < readfile.txt
    
  • | will redirect output to the input of the following command:

    command | othercommand
    

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .