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.
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.
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.
cat just combines the files into a single target (as requested). It doesn't store any information to get the original files back. If you want a file archive, then, yes, tar is a much better choice ;)
– Oliver Salzburg
May 12 '12 at 14:39
man tar. – Daniel Andersson May 12 '12 at 12:16