1.line=$(awk 'END{print NR}' filename) while((line!=0));do awk 'NR=='"$line"'' file;((line--));done 2.vim -c "g/^/m 0\|wq" file3.awk ' {line[NR] = } END {for(i = NR; i > 0; i--) print line[i]}' filename
原文转自:http://www.ltesting.net