⭐ in reply to What is the simplest way to print a field, as in $3 does in awk
perl -lane 'print if $F[1] =~ /localhost/' /etc/hosts [download]