Bash Concatenate files


Example

This is the primary purpose of cat.

cat file1 file2 file3 > file_all

cat can also be used similarly to concatenate files as part of a pipeline, e.g.

cat file1 file2 file3 | grep foo