With terminal: Cut files with split and join them with cat

Interesting article found in the GUTL Wiki, which teaches us how to cut and join files into parts. With the command split we can separate / cut files into pieces (for example, to send them by email).

$ split -b 1m archivo.7z cortado

With this we will obtain files of 1 MB called cut, cut ab, cut ac

With the command cat we can join all the parts of the file to restore it (note that they must all be in the same directory).

$ cat cortado* > new_archivo.7z

To organize ourselves more, we can add a simple underscore or a period at the end of the name of the cut file

$ split -b 1m archivo.7z cortado.

Thus we will obtain the files with the name cut.aa

-b It indicates the size in which the files are to be obtained, it can be specified in KB (-b 200k) or in MB (-b 1m).


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   sieg84 said

    Since 7z, how to compress in multiple files without using split?

    Something that makes me curious is that the cat command works even to join videos (videos in 2 parts or more) later with mencoder the video index is repaired. I think I remember that it was with the prefix -idx
    The same mencoder works to join videos.

  2.   Oscar said

    Great!!! I just tested it and it works very well, as you say your ideal for sending large files by email.

  3.   proper said

    This is the basic concept for file obfuscation 😉

  4.   taregon said

    ¿cat? That same command that I use to display the text in terminal? o_O wow!

    1.    taregon said

      and it returns my user-agent with the name 'x'buntu ...

    2.    moony said

      Be careful, don't say it so "Fedora" is going to propose an interview and say that with that distro "files can be joined more easily"

      https://blog.desdelinux.net/historias-de-usuarios-de-fedora-mairin-duffy/

  5.   Nonamed said

    I think it is easier to compress it in multiple volumes, in this way the recipient can read it regardless of the OS they use

  6.   Nonamed said

    or if not another even easier method, upload it to a hosting, you give the link by mail and that's it

  7.   miguelinux said

    I don't know if it's spam or not, but a few years ago I made a small graphical interface for precisely this reason and with those commands.
    In:
    http://split-gtk.blogspot.com.es/
    ó
    http://sourceforge.net/projects/split-gtk/
    (seriously, I'm not offended if you delete the comment for spam 😉)

    1.    Nonamed said

      We also have gnome-split, which is in the debian repos

      http://gnome-split.org

  8.   Yoyo Fernandez said

    Very interesting. Pointing !!!!

  9.   Manuel said

    Excellent contribution. Congratulations and thank you.