Combine Text Files into One File in Windows, Mac, and Linux

I ran into a problem where I had a zip file that had a document I wanted to copy split into 100 different .txt files. I needed to combine all of the text files into one large file so I could copy all the data.

Windows

You can combine text files in Windows using copy’s binary mode. From the command prompt navigate to the folder with the .txt files and run the following command:

copy /b filename* all.txt /b

Where filename* matches the pattern of your file names and all.txt is the output file.

Mac / Linux / Unix

You can combine files in the unix shell using cat and appending the output to a file:

cat filename* > all.txt

Where filename* matches the pattern of your file names and all.txt is the output file.

This should help save someone a lot of copy and pasting time.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join the TeamTutorials mailing list and get the latest tips, tricks, and special discounts for members only.

Thanks! Please click the link in the email we just sent you to confirm.

  • thank you
    very useful for me

  • kao

    simple and it works
    thank you.

  • Very simple yet very informative article.

  • Lousia Wendorff

    I was looking for CA VPI CF-1 several days ago and was made aware of a great service that has an online forms database . If people need CA VPI CF-1 too , here’s a https://goo.gl/fuCvRW