Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

lets say i have few files which have structure like

file1.txt

apple fruit 
tomato vegetable 

file2.txt

apple red green
tomato green yellow

is there a way to grep at once these 2 files (or more) to receive set of data like this one (or similar)

apple fruit red green
tomato vegetable green yellow
share|improve this question
add comment

1 Answer 1

Use join:

$ join file1.txt file2.txt
apple fruit  red green
tomato vegetable  green yellow
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.