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 (14 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.

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

  • SEWilco Says:

    Would be nice to know where the check_command definitions for all the plugins reside. Ubuntu's comm...

  • gregory wayne cox Says:

    my computer is hacked by someone bigtime, I need help capturing the information from all possible p...

  • admin Says:

    @lordspartner Hi, You can try to install the missing dependencies. sudo apt-get inst...

  • lordspartner Says:

    how do i fix the following error. im new to linux. dpkg: dependency problems prevent configuratio...

  • Raul Molnar Says:

    Nice, thanks....

  • admin Says:

    Poti incerca sa instalezi din surse. Daca accesezi link-ul asta in browser, te va intreba daca vrei ...

  • codrin Says:

    mai ai alte solutii?...

  • codrin Says:

    ioana@ioana-desktop:~$ sudo apt-get install libglib1.2-dev [sudo] password for ioana: Citire list...

  • admin Says:

    Aici poti gasi pachetul libglib1.2-dev: https://launchpad.net/ubuntu/karmic/+package/...

  • codrin Says:

    incerc sa instalez pe ubuntu 9.10 am urmat pasii descrisi de tine luand comenzile cu copy &paste...

Tag Cloud