1

How can I collect several files into a single file?

I tried GZip, but could only get it to create separate files.

It does not have to be compressed.

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311
rezx
  • 185

1 Answers1

5

Simply use cat:

cat file1 file2 file3 > output

If you want to combine all files in the current directory:

cat * > output

If you need to adjust the order of the files in the output, use echo first to get all filenames:

echo *

Then supply them in the desired order to cat.

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311