I have two files; I want to join them.
$cat t1
1 1.2
2 2.2
$cat t2
1
2
1
I want to have the output below
$cat joind.tx
join requires that both files to be sorted. If you sort them first, you'll get all your output
$ sort t1 > t1.sorted
$ sort t2 > t2.sorted
$ join -j1 -o 1.1,1.2 t1.sorted t2.sorted
1 1.2
1 1.2
2 2.2
Without the sort:
$ join -j1 -o 1.1,1.2 t1 t2
1 1.2
2 2.2
This assumes that the order of your inputs don't need to be preserved; if they do, you will need a custom script like other answers have provided.