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