Add

Split and join files in Ubuntu with lxsplit


Below I describe how to split a larger file into several small files. This is useful when the file you want to copy on a stick is bigger than the stick’s capacity.

The file used is this example is a 75 MB .mkv.

I will use lxsplit for splitting and joining the .mkv file. So, I need to install lxsplit:

wget http://sourceforge.net/projects/lxsplit/files/lxsplit/lxsplit-0.2.4.tar.gz/download

Decompression:

ducu@mylaptop:~/temp$ tar -xvvzf lxsplit-0.2.4.tar.gz

drwxrwxr-x ozzie/ozzie 0 2008-10-03 15:28 lxsplit-0.2.4/

-rw-rw-r– ozzie/ozzie 3200 2008-02-02 10:03 lxsplit-0.2.4/mkuoff_t.c

-rw-rw-r– ozzie/ozzie 1618 2008-05-31 11:03 lxsplit-0.2.4/Makefile

-rw-rw-r– ozzie/ozzie 2520 2008-07-02 20:15 lxsplit-0.2.4/func.c

-rw-rw-r– ozzie/ozzie 2440 2008-10-03 15:05 lxsplit-0.2.4/config.h

-rw-rw-r– ozzie/ozzie 4749 2008-02-02 10:03 lxsplit-0.2.4/merge.c

-rw-rw-r– ozzie/ozzie 1070 2008-02-02 09:45 lxsplit-0.2.4/merge.h

-rw-rw-r– ozzie/ozzie 2345 2008-10-03 15:09 lxsplit-0.2.4/README

-rw-rw-r– ozzie/ozzie 1715 2008-10-03 15:09 lxsplit-0.2.4/ChangeLog

-rw-rw-r– ozzie/ozzie 1174 2008-07-02 20:15 lxsplit-0.2.4/func.h

-rw-rw-r– ozzie/ozzie 1320 2008-10-03 15:25 lxsplit-0.2.4/lxsplit.spec

-rw-rw-r– ozzie/ozzie 1080 2008-02-02 10:03 lxsplit-0.2.4/split.h

-rw-rw-r– ozzie/ozzie 4375 2008-10-03 15:04 lxsplit-0.2.4/split.c

-rw-rw-r– ozzie/ozzie 3670 2008-10-03 15:03 lxsplit-0.2.4/main.c

-rw-rw-r– ozzie/ozzie 17990 2008-02-02 09:45 lxsplit-0.2.4/COPYING

Access the new folder and give the make command:

cd lxsplit-0.2.4/

make

Next, make install command. This is the result:

ducu@mylaptop:~/temp/lxsplit-0.2.4$ sudo make install

cp lxsplit /usr/local/bin

This is my 75MB .mkv file:

ducu@mylaptop:~/movies/Inside.Man.2006.1080p.HDDVD.x264-SZ/Sample$ ls -alh

total 75M

drwxr-xr-x 2 ducu ducu 4.0K 2009-07-21 21:28 .

drwxr-xr-x 3 ducu ducu 4.0K 2009-06-13 02:15 ..

-rw-r–r– 1 ducu ducu 75M 2009-06-13 02:47 Inside.Man.2006.1080p.HDDVD.x264-SZ-SAMPLE.mkv

I will split the 75 MB file in chunks of 20 MB.

ducu@mylaptop:~/movies/Inside.Man.2006.1080p.HDDVD.x264-SZ/Sample$ lxsplit -s Inside.Man.2006.1080p.HDDVD.x264-SZ-SAMPLE.mkv 20M

Splitting Inside.Man.2006.1080p.HDDVD.x264-SZ-SAMPLE.mkv into 4 pieces.

Inside.Man…SZ-SAMPLE.mkv.001 20971520 bytes

Inside.Man…SZ-SAMPLE.mkv.002 20971520 bytes

Inside.Man…SZ-SAMPLE.mkv.003 20971520 bytes

Inside.Man…SZ-SAMPLE.mkv.004 14767172 bytes

Done!

Now I will join the 4 resulted files:

ducu@mylaptop:~/movies/Inside.Man.2006.1080p.HDDVD.x264-SZ/Sample$ lxsplit -j Inside.Man.2006.1080p.HDDVD.x264-SZ-SAMPLE.mkv.001

Creating merged file `Inside.Man.2006.1080p.HDDVD.x264-SZ-SAMPLE.mkv’.

Complete size: 77681732 in 4 files.

Processing file `Inside.Man…SZ-SAMPLE.mkv.001′ …

Processing file `Inside.Man…SZ-SAMPLE.mkv.002′ …

Processing file `Inside.Man…SZ-SAMPLE.mkv.003′ …

Processing file `Inside.Man…SZ-SAMPLE.mkv.004′ …

Done!

If you used this tutorial or have any questions, feel free to leave a comment below. You can also rate this tutorial to let me know how I’m doing. Thanks! :)

1 Star2 Stars3 Stars4 Stars5 Stars (15 votes, average: 5.00 out of 5)
Loading ... Loading ...

The Discussion

see what everyone is saying

  • Dean July 22nd, 2009 at 10:53 #1

    Very good tutorial. Exactly what I needed.
    It would be amazing if it was in English, or if there was a plugin for translation.
    Thanks a lot!

  • admin July 22nd, 2009 at 11:42 #2

    @Dean

    I’m glad you find this helpful. Soon the translation plugin will be avaible. Come back and check it! :)

  • Raul Molnar August 3rd, 2009 at 14:37 #3

    Super tare, credeam ca sunt singurul care cautam asemenea informatii :) .

  • michael October 7th, 2009 at 18:40 #4

    Thank you for your help!

  • dealon October 23rd, 2009 at 19:46 #5

    Hi

    I got the following error while i tried ‘make’ on the lxsplit-0.2.4 folder.

    I have the structure as ~/download/lxsplit-0.2.4 .

    help requested.

    thx
    raj

  • admin October 23rd, 2009 at 22:47 #6

    @raj: Please specify the error you get.

  • Me July 3rd, 2010 at 00:18 #7

    lxsplit is in the ubuntu repositories – you can install with synaptic or apt.

  • Jimbo September 20th, 2010 at 02:07 #8

    Doesn’t work if you just split the files. Sure, you get 2 files of size specified – but if you view #1 – it will still show the full length and the second one will be soundless and garbled video.

  • Odi September 25th, 2010 at 06:34 #9

    Thanks for your step by step illustration!!
    worked perfectly for me ….
    keep up the good work…
    :)

  • Odi September 25th, 2010 at 06:39 #10

    :(
    im able to open just the first file … later ones seem corrupted
    help anyone??

  • Schedule October 30th, 2010 at 12:47 #11

    You you should make changes to the post subject Split and join files in Ubuntu with lxsplit | EtutsResourcesIT to something more specific for your blog post you create. I loved the the writing even sononetheless.

Respond

get in on the action.

* Required

Rumanian flagItalian flagEnglish flagGerman flagFrench flagSpanish flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagSwedish flagNorwegian flagSerbian flagSlovenian flagUkrainian flagTurkish flagHungarian flag
By N2H

Random Posts Recent Comments

  • admin Says:

    Amigo, Please formulate your question in english if you really need help! Cheers!...

  • Mauricio Gonçalves Says:

    Boa tarde, Amigo eu não consigo add novo user poderia me ajudar? ele fala que o comando não é ...

  • Flossy Says:

    Zubao0 That's really thinking out of the box. Thanks!...

  • Michael Esch Says:

    I used this tutorial to install Komodo Edit 6 on Ubuntu 10.10; I rate your tutorial 5/5 I hope that...

  • admin Says:

    @dan Am rulat aplicatii create in visual basic si in fox sub wine, deci cred ca nu ar trebui sa fie ...

  • dan Says:

    as dori sa imi spuneti daca un prg de conta sub visual basic ruleaza cu wine sub ubuntu intreb deo...

  • admin Says:

    Thank you all for your comments. As I was busy latelly, I haven't answer to your posts. I hope you u...

  • tcpdump Says:

    Hello, I also faced the error "It appears as though you do not have permission to view informatio...

  • Ali Says:

    awesome!!!...

  • Schedule Says:

    You you should make changes to the post subject Split and join files in Ubuntu with lxsplit | EtutsR...

Tag Cloud