DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Sort File By Length Of Lines

01.13.2007
| 14293 views |
  • submit to reddit
        Sort file by length of lines

cat $@ | awk '{ print length, $0 }' | sort -n | awk '{$1=""; print $0}'