Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-29-2012, 11:53 PM   #1
Registered: Aug 2011
Posts: 113

Rep: Reputation: Disabled
command to merge old with new files


I was wondering if anyone might be able to help me here. There is a program that I need to upgrade to the next version. However, instead of overwriting the old files with the new ones, it requires me to merge them. I have not done this myself before as I am still learning my way around ubuntu server 10.04 OS. I wonder what command I can use to merge two files together.

Any help would be greatly appreciated.

Thank you
Old 03-30-2012, 12:15 AM   #2
Senior Member
Registered: Apr 2007
Location: bbsr,orissa,India
Posts: 1,373

Rep: Reputation: 135Reputation: 135
cat command is there for concatenation.

man cat
merge file1 and file2 and save in file3.

cat file1 file2 > file3
Old 03-30-2012, 07:11 AM   #3
David the H.
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025Reputation: 2025
I think it would be better to get some more details before we go offering "solutions" based on guesswork.

Specifically, "merge" is a word that can have many different interpretations. The cat command given above simply appends the second file after the first one. But if you mean something that intersperses lines, removes duplicates, or what, you're going to have to detail that.

So give us an actual example of what you need to do. Post the input texts and the desired output. And don't forget to use [code][/code] tags to protect the formatting.

A few other details, like what this mysterious "program" is, might help too. Instead of posting vague descriptions, try reading How To Ask Questions The Smart Way, and give us some specifics. Thanks!


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Split and merge files from the command line LXer Syndicated Linux News 1 10-10-2012 03:43 AM
[SOLVED] Command to merge linewise from 2 files mandyapenguin Linux - Newbie 12 12-01-2011 09:16 PM
[SOLVED] awk command to merge two files silkysue Linux - Newbie 7 01-27-2011 11:14 AM
awk command to merge columns from two separate files into single file? johnpaulodonnell Linux - Newbie 4 01-23-2007 11:10 AM
Is there a command to merge two files as two columns of one file? davee Linux - General 2 07-19-2005 11:52 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:19 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration