Is there a way to merge two tables and keep only the matching values using linux bash?

qq122087013 注册会员
2023-01-25 08:32

It could be done with both:

grep -v -f file2 file1 >> file3 #thanks David Ranieri

Or with:

join -1 1 -2 1 file1 file 2 > file3

Using join with get you a warning join: file 1 is not in sorted order join: file 2 is not in sorted order but the result is correct

About the Author

Question Info

Publish Time
2023-01-25 08:32
Update Time
2023-01-25 08:32