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 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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s