If you put the filename twice after split it will relate to the filename, you can also split the file by number of bytes, e.g:
Code:
[root@localhost test]# dd if=/dev/zero of=./bigfile bs=1024k count=5
5+0 records in
5+0 records out
5242880 bytes (5.2 MB) copied, 0.0595227 s, 88.1 MB/s
[root@localhost test]# split --bytes=1024k bigfile bigfile.
[root@localhost test]# ls -lh
total 11M
-rw-r--r-- 1 root root 5.0M 2007-12-11 11:00 bigfile
-rw-r--r-- 1 root root 1.0M 2007-12-11 11:01 bigfile.aa
-rw-r--r-- 1 root root 1.0M 2007-12-11 11:01 bigfile.ab
-rw-r--r-- 1 root root 1.0M 2007-12-11 11:01 bigfile.ac
-rw-r--r-- 1 root root 1.0M 2007-12-11 11:01 bigfile.ad
-rw-r--r-- 1 root root 1.0M 2007-12-11 11:01 bigfile.ae
[root@localhost test]#
And you can rebuild the big text file with the following:
Code:
[root@localhost test]# rm -f bigfile
[root@localhost test]# for i in bigfile.*; do cat "$i" >> ./bigfile; done
[root@localhost test]# ls -lh
total 11M
-rw-r--r-- 1 root root 5.0M 2007-12-11 11:07 bigfile
-rw-r--r-- 1 root root 1.0M 2007-12-11 11:01 bigfile.aa
-rw-r--r-- 1 root root 1.0M 2007-12-11 11:01 bigfile.ab
-rw-r--r-- 1 root root 1.0M 2007-12-11 11:01 bigfile.ac
-rw-r--r-- 1 root root 1.0M 2007-12-11 11:01 bigfile.ad
-rw-r--r-- 1 root root 1.0M 2007-12-11 11:01 bigfile.ae
[root@localhost test]#