Finding the longest line in a fileEditCreated 2011-06-25, updated 2017-05-18$ cat file.text | awk '{print length, $0}' | sort -nr | head -1 Source: http://wtanaka.com/node/7719 wiki