split -n 5 splits the file into five parts making all but the last part have the same number of bytes.
If you want to do splitting only on line boundaries, use:
split -n l/5 -d -a 2 testfile
This is detailed in the GNU docs for
split as follows:
Split input to chunks output files where chunks may be:
n generate n files based on current size of input
k/n only output kth of n to stdout
l/n generate n files without splitting lines
l/k/n likewise but only output kth of n to stdout
r/n like ‘l’ but use round robin distribution
r/k/n likewise but only output kth of n to stdout
Another option is to specify how many lines you want in each output file:
split -l 1000 -d -a 2 testfile
The above splits the file into parts, each (except the last) with 1,000 lines. This is documented as:
Put lines lines of input into each output file.