AWK print longest line in file

awk ‘{ if (length($0) > max) {max = length($0); maxline = $0} } END { print maxline }’ YOURFILE