30
Mar

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.

Feel free to donate if this post prevented any headaches! Another way to show your appreciation is to take a gander at these relative ads that you may be interested in:


There's 1 Comment So Far

  • split urlaub
    January 30th, 2012 at 5:38 am

    great!
    cat thank_you_very_much.txt 😉

Share your thoughts, leave a comment!