30
Mar
Posted by Derek@TheDailyLinux » 1 Comment »
A Quick Usage Example of the Split Command
Have a file that needs to be split into pieces? Here’s a quick example of splitting the text file “test.txt” containing an arbitrary number of lines into several files each with 10 lines a piece and named “split_aa, split_ab, split_ac, …”.
cat test.txt | split -l 10 - split_
If you’d like to use numeric suffixes instead of alphabetic, use the ‘-d’ option in split. There’s more tips and tricks where that came from in the split man page, so be sure to check it out.