- 论坛徽章:
- 0
|
譬如:
# ls -l `ls -lrt | grep .tar | awk '{print $9}' | sort`
-rw-r--r-- 1 wapcare other 5314560 Nov 30 2009 NwgTps.tar
-rw-r--r-- 1 wapcare other 2339840 Nov 4 2009 config-gd22gw12.tar
-rw-r--r-- 1 wapcare other 5315005 Feb 9 09:45 explorer.84828174.GDGZ-PS-DB003-WAP22-2010.02.09.06.07.tar.gz
-rw-r--r-- 1 wapcare other 3210466 Feb 9 09:44 explorer.848287a0.GDGZ-PS-DB004-WAP22-2010.02.09.06.08.tar.gz
-rw-r--r-- 1 wapcare other 2863469 Jan 12 10:48 explorer.8494f340.GDGZ-PB-GW009-WAP22-2010.01.12.02.40.tar.gz
-rw-r--r-- 1 wapcare other 2869394 Jan 12 11:03 explorer.849dd686.GDGZ-PB-GW011-WAP22-2010.01.12.02.54.tar.gz
-rw-r--r-- 1 wapcare other 2857994 Jan 12 11:26 explorer.84a74edc.GDGZ-PB-GW018-WAP22-2010.01.12.03.14.tar.gz
-rw-r--r-- 1 wapcare other 70282240 Apr 28 10:28 explorer_WAP22.tar
-rw-r--r-- 1 wapcare other 527872 Jan 28 13:09 hs_err-gd22gw12.tar20100128
-rw-r--r-- 1 wapcare other 41472 Nov 27 2009 jeff.tar
-rw-r--r-- 1 wapcare other 5625344 Apr 5 22:48 lib.tar
# ls -lrt | grep .tar | awk '{print $9}' | sort
NwgTps.tar
config-gd22gw12.tar
explorer.84828174.GDGZ-PS-DB003-WAP22-2010.02.09.06.07.tar.gz
explorer.848287a0.GDGZ-PS-DB004-WAP22-2010.02.09.06.08.tar.gz
explorer.8494f340.GDGZ-PB-GW009-WAP22-2010.01.12.02.40.tar.gz
explorer.849dd686.GDGZ-PB-GW011-WAP22-2010.01.12.02.54.tar.gz
explorer.84a74edc.GDGZ-PB-GW018-WAP22-2010.01.12.03.14.tar.gz
explorer_WAP22.tar
hs_err-gd22gw12.tar20100128
jeff.tar
lib.tar
怎样取特定行的文件名?例如,第1个到第6个,然后第9个,之类的.
另外一个就是怎样实现取单双行? |
|