history去行号,与awk多列抓取
1. history去行号(awk抓取2-n列)
history|awk '{$1="";print $0 }'
或
history | sed 's/^[ ]*[0-9]\+[ ]*//'
2. awk多行抓取
history|awk '{for(i=2;i<=NF;i=i+1)printf " "$i;print ""}'
1. history去行号(awk抓取2-n列)
history|awk '{$1="";print $0 }'
或
history | sed 's/^[ ]*[0-9]\+[ ]*//'
2. awk多行抓取
history|awk '{for(i=2;i<=NF;i=i+1)printf " "$i;print ""}'