Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我进行搜索时:
dir /b /s *.txt
我得到所有带有扩展名的文件/文件夹.txt。但是当它们有扩展名时,我也会得到它们.txtx。如何搜索确切的扩展名?
.txt
.txtx
你可以试试这个
dir /s /b *.txt | findstr /v .txt.
或者
dir /s /b *.txt | findstr /e .txt
dir /b *.txt | findstr .txt$
我不知道为什么它会这样,但这有效:dir /b /s .txt | findstr /e .txt. 丑陋但有效。
dir /b /s .txt | findstr /e .txt