This question already has an answer here:

I need to append one trail record to both the files.

cat file1 >> file2

this appends everything in file1 to file2

My requirement is to append to file1 content to both file2 and file3.

marked as duplicate by Runium, don_crissti, Community Nov 16 '15 at 21:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Use tee:

tee -a file2 file3 < file1

tee send its input to each of the files specified as arguments to it. Usually it overwrites, but -a is tells it to append.

Not the answer you're looking for? Browse other questions tagged or ask your own question.