How to match files *.R and *Rd with find utility?

后端 未结 2 1095
温柔的废话
温柔的废话 2021-01-17 13:13

I would like to find all files that end with .c, .R, or .Rd. I tried

find . -iname \"*.[cR]\" -print
<
2条回答
  •  情话喂你
    2021-01-17 13:58

    Here you go =)

    find -name "*.c" -o -name "*.R" -o -name "*.Rd"
    

    If it's just the 3 extension types that you are looking for, I'd recommend staying away from regex and just using the -o (as in "or") operator to compose your search instead.

提交回复
热议问题