GNU/Linux Command – SPLIT

split — Split the files into pieces

Summary:
Split will read the input file and write into number of files as per the option given to it. By default, output file names will start with a prefix ‘x’ and followed by 2 suffix characters (aa, ab,..,zz). The length of the suffix can be changed. If the number of output files is not fit into suffix length, then last file will contain the remaining portion of file, which is more then the specified split size.

Examples:
$ split file -- Split the file into pieces, each output file willcontain 1000 (default value) lines. $ split -a 3 file -- Same as above. Output file will havesuffix of 3 chars (xaaa, xaab,..). $ split file part_ -- Same as 1st. Output file will have prefixas part_ (part_aa, part_ab,..). $ split -l 10 file -- Each output file will contain 10 lines. $ split -b10k file -- Each output file will contain 10KB data. $ split -d file -- Use numeric suffix (x00, x01,..) $ cat xaa xab xac > join-file -- Procedure to join the piecesback. NOTE: Files order is very much important.
Read: man split

Advertisements
Tagged with: ,
Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: