Linux 中如何运用awk截取文件名中部分内容? linux awk里面怎样用#*截取字符串
\u5728linux\u4e0b\u5982\u4f55\u63d0\u53d6\u6587\u672c\u6587\u4ef6\u7684\u90e8\u5206\u5185\u5bb9\uff1fawk/sed?sed -e "s/.\/report_//" -e "s/totals//" -e "s/://" test.txt
sed -e "s/.\/report_//;s/totals//;s/://" test.txt
\u662f\u8bf4\u6309 # \u53f7\u6765\u505a\u5206\u9694\u7b26\uff0c\u5e76\u4e14\u652f\u6301 n\u4e2a#\u53f7\u7684\u60c5\u51b5\u5417
awk -F'#*' '{print$1"\t"$2"\t"$3}' abc.txt
abc.txt \u5185\u5bb9\u53ef\u4ee5\u662f
1#2##3###4#5
\u53ef\u4ee5\u628a\u4f60\u7684\u5177\u4f53\u6587\u4ef6\u548cawk\u547d\u4ee4\u8d34\u51fa\u6765
试一下如下代码:
ls -ltr *20100502* | awk -F "ICIMSIDIFF" '{print $2}'|cut -b 1-2
ls -ltr|awk '{print $8}'|cut -c11-12
扩展阅读:linux网站入口 ... linux xcopy ... it人必看的网站 ... linux free ... kali linux手机直装版 ... linux awk if ... javascript入门 ... linux awk 输出 ... linux mmap ...