Use find command but exclude files in two directories

前端 未结 6 1074
刺人心
刺人心 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 23:09

    You can try below:

    find ./ ! \( -path ./tmp -prune \) ! \( -path ./scripts -prune \) -type f -name '*_peaks.bed'
    

提交回复
热议问题