There is a join command in coreutils

I was poking around coreutils, looking at the commands that I have never heard of, and I found the join command.  Here is the explanation of from the man page.

The join utility performs an “equality join” on the specified files and writes the result to the standard output.

So, it sounds like the command is like a SQL join…

Here is a simple example of how it can be used.

$ ls
join.a join.b
$ cat join.a
1 test1
2 test2
3 test3
$ cat join.b
1 b.test1
2 b.test2
3 b.test3
$ join join.a join.b
1 test1 b.test1
2 test2 b.test2
3 test3 b.test3

Not sure of the utility of this command, but you never know.

Leave a Reply

Your email address will not be published. Required fields are marked *