quick post: split files on linux
March 22, 2009
This is a short post, so lets see, imagine you have a file called file_to_share of 1.5gb and you want to move that file to another PC using a 1gb usb flash drive, obviously the file just don’t fit in the flash drive available space, so an easy and fast way to cut that file into smaller ones that fit on the flash drive is to use the command split
split -db 900M file_to_share splitted
-d use numeric suffixes instead of alphabetic
-b 900M this is the desirable size for the output files, M is for Megabytes, K for kilobytes and b for bytes
file_to_share input file
splitted is the prefix for the output files, if you don’t use a prefix, the files will be named 00, 01, 02…
After the command finish, you will have two files splitted00 and splitted01, for join this files you can use the cat command
cat splitted01 >> splitted00
and the original-size file will be splitted00.
For deeper info, you can take a look on man split
1.
javier_galicia | March 22, 2009 at 10:40 pm
That’s sounds good, i can tell you HOZ software works the same that command, http://hoz.sourceforge.net/ ; very well(y)
2.
istodi | March 22, 2009 at 10:53 pm
I tried hoz but don’t know why with a 4.5gb file it just crashed :S