split – split a file into pieces . split [OPTION]… [INPUT [PREFIX]]

commandline session

$ls
sexample
$cat sexample
a
b
c
d
e
f
g
h
i
j
k
l
$split 3 sexample
split: cannot open ‘3’ for reading: No such file or directory
$split sexample 3
$ls
3aa  sexample
$ls -l
total 8
-rw-r--r-- 1 jeffrin jeffrin 24 Jul 31 21:52 3aa
-rw-r--r-- 1 jeffrin jeffrin 24 Jul 31 21:51 sexample
$cat 3aa
a
b
c
d
e
f
g
h
i
j
k
l
$split -n 5  sexample
$ls -l
total 28
-rw-r--r-- 1 jeffrin jeffrin 24 Jul 31 21:52 3aa
-rw-r--r-- 1 jeffrin jeffrin 24 Jul 31 21:51 sexample
-rw-r--r-- 1 jeffrin jeffrin  4 Jul 31 21:54 xaa
-rw-r--r-- 1 jeffrin jeffrin  4 Jul 31 21:54 xab
-rw-r--r-- 1 jeffrin jeffrin  4 Jul 31 21:54 xac
-rw-r--r-- 1 jeffrin jeffrin  4 Jul 31 21:54 xad
-rw-r--r-- 1 jeffrin jeffrin  8 Jul 31 21:54 xae
$cat xaa
a
b
$cat xae
i
j
k
l
$cat xab
c
d
$cat xac
e
f
$cat xad
g
h
$

inner working

Leave a comment

Your email address will not be published. Required fields are marked *