Bash sort by regexp

后端 未结 4 427
自闭症患者
自闭症患者 2020-12-31 15:45

I have something about 100 files with the following syntax

ahfsdjfhdfhj_EPI_34_fdsafasdf
asdfasdf_EPI_2_fdsf
hfdjh_EPI_8_dhfffffffffff
ffffffffffasdfsdf_EPI_         


        
4条回答
  •  情深已故
    2020-12-31 16:11

     sed -e 's/EPI_/EPI /' file1 file2 ...|sort -n -k 2 -t ' '
    

    Pipe that to sed -e 's/ /_/' to get back the original form.

提交回复
热议问题