I have files similar to this:
File1:
1.1.1.7 mounting of udf filesystems is disabled Fail
1.1.1.8 mounting of FAT filesystems is disabled Fail
1.1.5 noexec option set on /tmp partition Fail
1.1.17 noexec option set on /dev/shm partition Fail
1.1.21 sticky bit is set on all world-writable directories Fail
1.3.1 AIDE is installed Fail
File2:
1.1.1.7 Ensure mounting of udf filesystems is disabled
1.1.1.8 Ensure mounting of FAT filesystems is disabled
1.1.3 Ensure nodev option set on /tmp partition
1.1.4 Ensure nosuid option set on /tmp partition
I want to compare the two files on the first column and output where they match. For the content above, the output would be:
1.1.1.7 Ensure mounting of udf filesystems is disabled
1.1.1.7 mounting of udf filesystems is disabled Fail
1.1.1.8 Ensure mounting of FAT filesystems is disabled
1.1.1.8 mounting of FAT filesystems is disabled Fail
How would I do this?
Also how would I reverse it so I can show those that have no match? Comparing File1 to File2 and vice versa?