Printing everything except the first field with awk

前端 未结 16 2641
北恋
北恋 2020-12-04 07:04

I have a file that looks like this:

AE  United Arab Emirates
AG  Antigua & Barbuda
AN  Netherlands Antilles
AS  American Samoa
BA  Bosnia and Herzegovina         


        
16条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 07:54

    Use the cut command with the --complement option:

    $ echo a b c | cut -f 1 -d ' '
    a
    $ echo a b c | cut -f 1,2 -d ' '
    a b
    $ echo a b c | cut -f 1 -d ' ' --complement
    b c
    

提交回复
热议问题