Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently I'm using an awk line to filter a set of files according to certain criteria.

How can I redirect the result output to more than one file if the result, for example if the file that would be generated is larger than 1 Mb or has more than N lines? I want to name my results result_1.txt, result_2.txt, etc.

p.s: I want to split my result in files of 1Mb or N lines

share|improve this question
up vote 2 down vote accepted

Pipe the output to split

man split

share|improve this answer

You must log in to answer this question.

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