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 ""}'

 

posted @ 2023-04-07 09:51  咿呀哒喏  阅读(18)  评论(0编辑  收藏  举报