version 1.0.0, 2013-10-19 : Initial version
Lines present in different files (examples for 2 or 3)
A perl one-liner to extract lines common to 2 or 3 files.1. Extracting lines conmmon in 2 files
This shell command returns all lines that are exactly the same in 2 given files.
Note that this command has been posted by Randal Schwartz on PerlMonks.
perl -ne 'print if ($seen{$_} .= @ARGV) =~ /10$/' file_1.txt file_2.txt
2. Extracting lines conmmon in 3 files
This shell command returns all lines that are exactly the same in 3 given files.
perl -ne 'print if ($seen{$_} .= @ARGV) =~ /210$/' file_1.txt file_2.txt file_3.txt