t28292
t28292

Reputation: 573

how to merge two files into one file in Unix bash?

i have two files:

filea          fileb
apple          juice
orange         pieces
pineapple      juice

I want to store in a new file the output

applejuice
orangepieces
pineapplejuice

meaning concatenate the 2 files in unix bash i tried paste filea.txt fileb.txt > new.txt but i had an error is there another option? thank you

Upvotes: 0

Views: 4410

Answers (1)

devnull
devnull

Reputation: 123668

I'm not sure what you mean by error while invoking paste but you probably wanted to specify the delimiter:

paste -d '' filea fileb > new.txt

This would yield:

applejuice
orangepieces
pineapplejuice

Upvotes: 3

Related Questions