分类: LINUX
2013-04-08 10:17:55
##我们在处理话单时,先把想要的话单挑选出来,这里挑选出AAA的话单,然后根据对应的字段来排序
#一般用 -k 参数,+0.4 一般用在文件名比较规整的情况下
<48 rbi [rbi] :/home/ChinaTelCdrTransScript/test>ls -l | grep ^- | awk '{print $NF}' | sed -n '/^AAA/p' | sort -t_ +0.4
AAA_01_20100318_0212_7209.TXT
AAA_01_20100319_0210_7210.TXT
AAA_01_20100319_0211_7209.TXT
<49 rbi [rbi] :/home/ChinaTelCdrTransScript/test>ls -l | grep ^- | awk '{print $NF}' | sed -n '/^AAA/p' | sort -t_ -k 4
AAA_01_20100319_0210_7210.TXT
AAA_01_20100319_0211_7209.TXT
AAA_01_20100318_0212_7209.TXT
<50 rbi [rbi] :/home/ChinaTelCdrTransScript/test>ls -l | grep ^- | awk '{print $NF}' | sed -n '/^AAA/p' | sort -t_ -k 5
AAA_01_20100318_0212_7209.TXT
AAA_01_20100319_0211_7209.TXT