How to reverse column order of a file in Linux from the command line

后端 未结 4 498
长发绾君心
长发绾君心 2021-01-04 03:59

I have a file named ip-list with two columns:

IP1    Server1
IP2    Server2

And I want to produce:

4条回答
  •  北荒
    北荒 (楼主)
    2021-01-04 05:02

    Use awk:

    awk '{print $2,$1}' ip-list
    

    That should give you what you want.

提交回复
热议问题