Splitting files into a new folder
@Rob has the answer, and here's a small script using it that tries to defend against BASH's deficiencies as a programming language:
#!/bin/bash# make BASH fail on errors and unset variablesset -euoutput='output_dir'file_to_split="helloworld.txt"# make the directory# -p means no errors if the directory is there alreadymkdir -p "${output}"split -l 20000 "${file_to_split}" "${output}/${file_to_split}."