cat /etc/hosts | perl -ne 'print if (split(/\s+/,$_))[1] =~ localhost'