How to delete multiple files at once in Bash on Linux?

前端 未结 7 635
有刺的猬
有刺的猬 2021-01-29 19:09

I have this list of files on a Linux server:

abc.log.2012-03-14
abc.log.2012-03-27
abc.log.2012-03-28
abc.log.2012-03-29
abc.log.2012-03-30
abc.log.2012-04-02
ab         


        
相关标签:
7条回答
  • 2021-01-29 19:49

    I am not a linux guru, but I believe you want to pipe your list of output files to xargs rm -rf. I have used something like this in the past with good results. Test on a sample directory first!

    EDIT - I might have misunderstood, based on the other answers that are appearing. If you can use wildcards, great. I assumed that your original list that you displayed was generated by a program to give you your "selection", so I thought piping to xargs would be the way to go.

    0 讨论(0)
提交回复
热议问题