Bash/Linux Sort by 3rd column using custom field seperator

后端 未结 3 659
梦谈多话
梦谈多话 2021-01-16 18:20

I can\'t seem to sort the following data as I would like;

find output/ -type f -name *.raw | sort 
output/rtp.0.0.raw
output/rtp.0.10.raw
output/rtp.0.11.raw         


        
3条回答
  •  滥情空心
    2021-01-16 18:35

    sort -t'.' -n -k3
    

    to sort the 3th column from smallest to biggest

    And if you want to sort from biggest to smallest, you can use '-r' option :

    sort -t'.' -n -r -k3
    

提交回复
热议问题