Split text file into smaller multiple text file using command line
I have multiple text file with about 100,000 lines and I want to split them into smaller text files of 5000 lines each. I used: split -l 5000 filename.txt That creates files: xaa xab aac xad xbe aaf files with no extensions. I just want to call them something like: file01.txt file02.txt file03.txt file04.txt or if that is not possible, i just want them to have the ".txt" extension. I know the question has been asked a long time ago, but I am surprised that nobody has given the most straightforward unix answer: split -l 5000 -d --additional-suffix=.txt $FileName file -l 5000 : split file into