38 How print longest line in file?

awk '{ if ( length > x ) { x = length; y = $0 } }END{ print y }' ./file.tex
 

Thanks to Keith Thompson at https://unix.stackexchange.com/questions/24509/how-to-print-the-longest-line-in-a-file