How to print last two columns using awk

后端 未结 6 1350
甜味超标
甜味超标 2021-01-29 19:16

All I want is the last two columns printed.

6条回答
  •  没有蜡笔的小新
    2021-01-29 19:30

    awk '{print $NF-1, $NF}'  inputfile
    

    Note: this works only if at least two columns exist. On records with one column you will get a spurious "-1 column1"

提交回复
热议问题