How to merge multiple files into one in Linux?

Member

by sallie , in category: General Help , 4 months ago

How to merge multiple files into one in Linux?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by wayne.swaniawski , 4 months ago

@sallie you can use cat to concatenate 2 files or more files into one in Linux.


1
cat filename.txt filename2.txt > filename3.txt

This command will read the contents of filename and filename2 and redirect the output to a new file, filename3. If you run cat filename 3, it will output the result of the merge.