Windows命令行搜索与dir的精确扩展 [英] Windows command line search for exact extension with dir

查看:103
本文介绍了Windows命令行搜索与dir的精确扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我进行搜索时:

dir /b /s *.txt

我得到扩展名为 .txt 的所有文件/文件夹。但我也得到他们,当他们有一个扩展,例如 .txtx 。如何搜索确切的扩展程序?

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?

推荐答案

您可以尝试此

dir  /s /b *.txt | findstr /v .txt.

dir  /s /b *.txt | findstr /e .txt

dir  /b *.txt | findstr  .txt$

这篇关于Windows命令行搜索与dir的精确扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆