When I do a search:
dir /b /s *.txt
I get all files/folders with the extension .txt
. But I also get them when they have an extension like .txtx
. How can I search for the exact extension?
You can also search for a particular file type by using a command dir \*. pdf /s and it will show you all files saved with the . pdf extension.
For finding a specific file type, simply use the 'type:' command, followed by the file extension. For example, you can find . docx files by searching 'type: . docx'.
you can try this
dir /s /b *.txt | findstr /v .txt.
or
dir /s /b *.txt | findstr /e .txt
or
dir /b *.txt | findstr .txt$
I can't figure out why it behaves like this, but this works: dir /b /s .txt | findstr /e .txt
. Ugly but works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With