Tuesday, February 9, 2016

split command



Split command is very useful in splitting the larger file into number of small files.


split -l 100 -a 3 edch_all_vectors.txt  edch_all_vectors

 -a, --suffix-length=N   use suffixes of length N (default 2)
  -b, --bytes=SIZE        put SIZE bytes per output file
  -C, --line-bytes=SIZE   put at most SIZE bytes of lines per output file
  -d, --numeric-suffixes  use numeric suffixes instead of alphabetic
  -l, --lines=NUMBER      put NUMBER lines per output file

The above command will split the edch_all_vectors.txt into smaller files with hundred lines in each file and filenames like edch_all_vectors_xxx (Note:- suffix 3 letters since we have -a 3).

1 comment: