YOU
YOU

Reputation: 333

Find a file in Cygwin

I use find -name "nametofind" in cygwin to search for a file, but it does not give me any result, even when the file I want to search exists in the current directory. What am I doing wrong? Thanks.

Upvotes: 1

Views: 2411

Answers (1)

merlin2011
merlin2011

Reputation: 75555

As the comment mentioned more succinctly, you need to tell find which directory you want to search. If you it is the current directory, you should use ..

find . -name "nametofind"

It appears that the OP was trying to either match a partial file name or a file name with a different case. As @devnull mentioned in his comment, the correct solution for either case is to use the following.

find . -iname '*nametofind*'

Upvotes: 1

Related Questions