Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is there a way to merge 2 text files into one (by appending the content of the second right after the first one) in Unix ?

share|improve this question
    
Not really a merge, you just append one file after another. –  Johan Jun 11 '11 at 20:06
add comment

1 Answer

up vote 7 down vote accepted

Assuming bash as shell or bash script...


Append file2 to file1 (keeping file2 in original state):

cat file2 >> file1


Or this (keeping both original files around):

cat file1 file2 > new_merged_file

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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