按每行长度排序文本行 2016 年1 月20 日 I have a file containing quite many lines of strings and I want to sort them by line length. Here is how. 1 cat $file | awk '{ print length($0) " " $0; }' | sort -r -n | cut -d ' ' -f 2- | less