Say, I have a command command
which prints huge number of lines to stdout:
line1
line2
.....
lineN
I want to save the output to disk, but not as a single file, but as a sequence of files each having 1000 lines of stdout:
file0001.txt:
-------------
line1
....
line1000
file0002.txt:
-------------
line1001
....
line2000
etc
I've tried to google the answer, but every time google points me to tee
command, which is useless in this situation. Probably, I'm entering wrong queries.