Print duplicate lines

I have a file where some of the lines are duplicates.

How do I use bash to print all the lines that have duplicates?

awk 'arr[$0]++; END {for(i in arr ){ if(arr>1){print i}   }   }' inputfile
awk '$0==s{print s RS $0}{s=$0}' file