How do I get the first 20 lines of a OS X Terminal result?


The command you want is head

so for a command x and the first 20 lines you enter

x | head -n 20

This runs x and pipes the input into the head command.

| improve this answer | |

If the output is from a command you are running, you can pipe the output to the head command.

$ ls -l | head -n 10
| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .