in reply to find common lines in many files

I would make it with a bit of bash pipelining:

- sort for sorting file by file
- uniq for only count one line by file
- sort again to be sure only interesting lines will be printed (with the help of uniq -c)
- perl to print interesting lines
files=(MYFILES/*.txt) for f in ${files[*]} do sort -u $f ; done | sort | uniq -c | perl -ne 'if (/[[:space:]]+'"$((${#files}+1)) "'(.*)/) {print $1."\n"; +}'
Regards,