How-To: Join multiple files

Introduction

It often happens that we have split files, such as text files, which contain a set of information split for a reason.

Let me give you an example:

I needed to upload some IP addresses to my firewall blacklist.
Unfortunately I had more than one hundred files, containing this information, splitted by geographical area.
To be honest, I didn’t want to upload the files one at a time.

For this reason, I had thought of creating a single file by unifying all the others.

How-To

We have different solution depending by the OS in use.
Anyway, we will use the cmd-line to perform this operation.

Windows

The command to use is the copy

copy /b *.txt joinfile.txt

OSX and Linux

The command to use is cat

cat *.txt > joinfile.ext