I need a utility that will print the first n lines, but then continue to run, sucking up the rest of the lines, but not printing them. I use it to not overwhelm the terminal with the output of a process that needs to continue to run (it writes results to a file).
I figured I can do process | {head -n 100; cat > /dev/null}
, but is there something more elegant?
trap '' PIPE
– Satō Katsura Jul 05 '16 at 07:17