Linux教程:文本操作倒序输出

字体大小: 中小 标准 ->行高大小: 标准

Linux系统环境:CentOS  5.7 i686

测试文件:cat test.bat

CentOS

1、系统命令:tac test.bat

CentOS

2、awk方法: awk '{a[NR]=$0}END{for(i=NR;i>0;i--)print a[i]}' test.bat

CentOS

3、sed方法: sed '1!G;h;$!d' test.bat

CentOS

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/66457.html