Join (merge / concatenate) split files: Windows or Linux

Sometimes you have to join two files together. There are plenty of tools for file spitting and joining (restoring), but I prefer the build in ones.

Use copy command under Windows:
copy /B file1.ext + file2.ext result_file.ext
“B” stands for binary file

Use cat command under Linux:
cat file1.ext file2.ext > result_file.ext

Here are two example files shown in hexadecimal and ascii:

file1.ext
00000000 31 31 31 20 61 62 63 0D   111 abc.
00000008 0A 0D 0A                  ...

file2.ext
00000000 53 65 63 6F 6E 64 20 66   Second f
00000008 69 6C 65 0D 0A            ile..

after concatenation result_file.ext contains contents of both files
00000000 31 31 31 20 61 62 63 0D   111 abc.
00000008 0A 0D 0A 53 65 63 6F 6E   ...Secon
00000010 64 20 66 69 6C 65 0D 0A   d file..

Leave a Reply

Your email address will not be published.