0

I'm trying to recursively look for C Sharp files containing specific text using a bash prompt on Windows Subsystem for Linux.

If I type grep -l -i -r "public virtual List<" /mnt/c/mycode/* it works.

However, I'd like to just search the C Sharp files

If I type grep -l -i -r "public virtual List<" /mnt/c/mycode/*.cs I see:

grep: /mnt/c/Workspaces/locumsmart/*.cs: No such file or directory

Is there a way to just search for a particular file extension?

Eric
  • 1,343

1 Answers1

1

Use --include=\*.cs

grep -l -i -r --include=\*.cs "public virtual List<" /mnt/c/mycode/*