Print the longest line in a file using awkEditCreated 5/27/2011, updated 5/18/2017$ awk '{ if ( length >a ) { a = length; b=$0 }}END{ print b }' filename awkwiki