32

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?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
syntagma
  • 12,091
  • 21
  • 57
  • 74

2 Answers2

47

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.
Law29
  • 1,136
  • 1
  • 9
  • 18
Thomas Dickey
  • 75,040
  • 9
  • 171
  • 268
  • 8
    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 08 '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.

Siva
  • 9,017
  • 8
  • 56
  • 86