Use find command but exclude files in two directories

前端 未结 6 1130
刺人心
刺人心 2021-01-29 22:16

I want to find files that end with _peaks.bed, but exclude files in the tmp and scripts folders.

My command is like this:

6条回答
  •  耶瑟儿~
    2021-01-29 22:52

    Here is one way you could do it...

    find . -type f -name "*_peaks.bed" | egrep -v "^(./tmp/|./scripts/)"
    

提交回复
热议问题