wc -L file

Category: Administration

wc -L file

Print the longest line length

The -L flag reports the length of the longest line in characters instead of counting lines or words. It is handy for checking whether any line overflows a fixed-width report or terminal column. Combine with sort -n to rank line lengths across many files.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.