How to join columns of two files on a unix system

I have 2 files, each file has one column with several rows, and the rows of each file are the same. How can I combine the columns of 2 files together so that the final result file has two columns from file1 and file2?

For example, file1 is:

1 2 3 

and file2 is:

 a b c 

and expected result:

 1 a 2 b 3 c 
+8
source share
1 answer

Just use the paste command. Use it like this: paste file1 file2

+21
source

All Articles