8

Let's assume that I've got two text file a, b.

$cat a
a a
a a
a a

$cat b
b b
b b
b b

Then, I want to merge these two file vertically by using paste. The merged file is shown bellow

a a
a a
a a
b b
b b
b b

NOT

$paste a b > AB
$cat AB
a a b b
a a b b
a a b b
ctrl-alt-delor
  • 27,473
  • 9
  • 58
  • 102
comphys
  • 319
  • 1
  • 3
  • 7

1 Answers1

6

Just cat a.txt b.txt > out.txt. If you want even spaces and no blank lines

$ awk 'NF' inputA.txt inputB.txt                           
a a
a a
a a
b b
b b
b b
Sergiy Kolodyazhnyy
  • 16,187
  • 11
  • 53
  • 104