问题
I would like to split a huge text file into separate text files. I use:
split -l 1000 file.txt split_file
and I will get split_fileaa
, split_filebb
, etc.
How can I change the extension to be
split_file0.txt, split_file1.txt, etc
?
回答1:
--additional-suffix
is what you need for the additional suffix :
split -l 1000 -d --additional-suffix=.txt file.txt split_file
回答2:
There is a -d
option for numeric suffixes.
来源:https://stackoverflow.com/questions/19549206/changing-the-output-filenames-in-split