That sort of thing is usually the result of a program which manipulates the terminal directly and moves the cursor around on it's own. For example, that's what editors like vi do - if you try to scroll the shell back after a vi session, you only see the text in the last page of vi output, not anything else you paged through.
Ways to deal with this:
- Use a tool like screen(1) and enable logging (
ctrl-A H). Then you can review the log later. That might show more useful info.
- Try using tee(1) to capture the output as it goes by with
command | tee output.txt
- Determine how to disable any fancy output mode in the program you are running and force it to spit out plain text.
For that last one there are a few things you can try. First, look at the arguments to the command and see if there's anything like
-nostty or anything talking about
You can also try forcing the program to think it's on a dumb terminal like this:
(assuming bash shell) and that might make the program think it's running on a dumb terminal and cause it to switch back to straight text output.
You can also try feeding the program some input and that might trigger it's simple text output mode:
echo blarg | command
echo blargh | command -
if the program takes
- as an indication to read from stdin.
Anyway, experiment with those ideas and you should find some way to get straight text output from the tools you are using.