Q:

Creating a file by merging two files

I would like to merge two files and create a new file using Linux command.
I have the two files named as a1b.txt and a1c.txt
Content of a1b.txt 
Hi,Hi,Hi
How,are,you

Content of a1c.txt
Hadoop|are|world
Data|Big|God

And I need a new  file called merged.txt with the below content(expected output)
Hi,Hi,Hi
How,are,you
Hadoop|are|world
Data|Big|God

To achieve that in terminal I am running the below command,but it gives me output like below
Hi,Hi,Hi
How,are,youHadoop|are|world
Data|Big|God

cat /home/cloudera/inputfiles/a1* > merged.txt

Could somebody help on getting the expected ouput

A:

Probably your files do not have newline characters. Here is how to put the newline character to them.
 $ sed -i -e '$a\' /home/cloudera/inputfiles/a1*
 $ cat /home/cloudera/inputfiles/a1* > merged.txt

