-2

What I'm trying to do:

With cat command create a file named Merge which is the merge of
test.txt and Copy(in a different directory than test.txt)

Both test.txt and Copy contain the same content:

reglib
test.txt

So what I expect is:

reglib
test.txt
reglib
test.txt

What I've tried:

cat /home/eleve/Copy | cat test.txt >Merge.txt
cat /home/eleve/Copy >Merge.txt | cat test.txt >Merge.txt
cat /home/eleve/Copy >Merge.txt | cat test.txt >>Merge.txt

And all of those command gave me the same wrong result:

reglib
test.txt

Can anyone please suggest me the right command? thanks.

Daniel_Kamel
  • 610
  • 8
  • 29

1 Answers1

3

You can use "cat" on multiple files, in which case it'll print them out in order.

cat test.txt Copy