“find: paths must precede expression:” How do I specify a recursive search that also finds files in the current directory?

前端 未结 6 1845
谎友^
谎友^ 2020-11-28 01:49

I am having a hard time getting find to look for matches in the current directory as well as its subdirectories.

When I run find *test.c

6条回答
  •  情歌与酒
    2020-11-28 02:31

    I came across this question when I was trying to find multiple filenames that I could not combine into a regular expression as described in @Chris J's answer, here is what worked for me

    find . -name one.pdf -o -name two.txt -o -name anotherone.jpg
    

    -o or -or is logical OR. See Finding Files on Gnu.org for more information.

    I was running this on CygWin.

提交回复
热议问题