Limit output of all Linux commands

Posted by daniel on Stack Overflow See other posts from Stack Overflow or by daniel
Published on 2011-12-01T01:19:09Z Indexed on 2011/12/01 1:51 UTC
Read the original article Hit count: 127

Filed under:
|

I'm looking for a way to limit the amount of output produced by all command line programs in Linux, and preferably tell me when it is limited.

I'm working over a server which has a lag on the display. Occasionally I will accidentally run a command which outputs a large amount of text to the terminal, such as cat on a large file or ls on a directory with many files. I then have to wait a while for all the output to be printed to the terminal.

So is there a way to automatically pipe all output into a command like head or wc to prevent too much output having to be printed to terminal?

© Stack Overflow or respective owner

Related posts about linux

Related posts about bash