25

I have a command which outputs lots of data (say, strace with lots of syscalls, running for a few minutes).

Is there any option (e.g. command wrapper or something similar) that would allow me to pause the output of the command (just the output on the screen, I don't mind the command running in the background), then unpause it after I take a look on its output?

39

You have three options:

  • press controlS to stop output, controlQ to resume (this is called XON/XOFF)
  • redirect your output to a pager such as less, e.g., strace date | less
  • redirect your output to a file, e.g., strace -o foo date, and browse it later.
1
  • 7
    Note that stopping the output with either of the two first options here will make the data generating program pause too, while it waits for the output stream to be consumed.
    – Kusalananda
    Jul 8 '16 at 11:25
2

use the | pipe for example

ifconfig -a | more

this will list until screen is full and one can then scroll further by hitting return / enter.

1
  • 1
    I prefer this to less because it exits naturally. Mar 31 '20 at 3:13

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.