Linux Basic Commands

Split Files

SPLITTING FILES

Split file into 1Mb per file

$ split -b 1m first_100k.csv new

 

 

Split file into two files.

$ split -n 2 first_100k.csv new

 

 

Split per 20 rows

$ split -l 20 first_100k.csv new

 

 

EXTRACT FROM FILE

Extract first 10000 lines from a file and create a new file:

$ head -10000 01_100k_all.csv >> 1_10k_test.csv