How to Concat a Bunch of Files Together

Here are 2 different shell commands using cat. These examples would allow you to stack files into a new file concatenating them together. Useful for example to stact CSV’s into a new larger CSV. The 1st example justs makes a new file, leaving all existing files alone. The second, removes them one by one which would be useful if you were low on drive space.

concat them all together, keeping existing files

cat file1 file2 file3 ... fileN >> newBigFile

concat them together and remove them one at a time

for file in file1 file2 file3; do
    cat "$file" >> newBigFile && rm "$file"