1

I have a terminal command which gives me very long output and I want to check this output from the very first line of it. So far I have to scroll with the mouse and try to catch it, which is quite annoying (especially if I executed this command few times). Is there a way to scroll the output to, say, last executed command?

1

You can pipe the output of said program to a pager program or a file that you can scroll through at your leisure.

To the less pager: the-program --args 2>&1 |less

To a file: the-program --args 2>&1 >> output.log

  • what does 2>&1 stands for? – wasd Mar 9 '18 at 15:06
  • It pipes stderr to stdout so that any error messages generated by the program will show up in the pager or output file. – dsstorefile1 Mar 10 '18 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.