Using the DOS copy command syntax to concatenate files:
copy file1.txt+file2.txt all.txt
I know I can do this…
copy file1.txt+file2.txt file1.txt
Is this efficient? Is it doing what I'm expecting? It works, but I want to know is it actually appending to file1.txt or is it copying file1.txt (bad), concatenating file2 and then renaming to file1.txt (which is not efficient)?
Best Answer
copy
is copyingfile1.txt
andfile2.txt
into memory, concatenating them then writing out tofile1.txt
. It's not copying to a new file then renaming that file so really there's not much extra disk I/O.You can also use
type
.The
>>
operator appends text. But that will, of course, not work for binary files.