![命令提示符打开资源管理器](https://i-blog.csdnimg.cn/blog_migrate/210a7097667d90fb60246d3a15a9820f.png)
命令提示符打开资源管理器
![](https://i-blog.csdnimg.cn/blog_migrate/fb1b054f9f1d5219e4563f974fe15441.png)
Searching for a file in Windows Explorer takes forever, but there’s a faster way if you’re willing to use the command prompt.
在Windows资源管理器中搜索文件需要花费很多时间,但是如果您愿意使用命令提示符,则可以采用一种更快的方法。
The amazing Twitter account SwiftOnSecurity posted this gem yesterday:
令人惊叹的Twitter帐户SwiftOnSecurity昨天发布了此宝石:
Stupid dirty cheap way to search an entire Windows drive for wildcard text in a file name, that I use all the time. 50x faster than trying to use Explorer.
一种愚蠢的廉价廉价方法,它在整个Windows驱动器中搜索我一直使用的文件名中的通配符文本。 比尝试使用资源管理器快50倍。
1.) dir "search term*" /s
1.)目录“搜索词*” / s
means start from root and /s means subdirectoriesExample shows all .log files:dir *.log /s
表示从root开始,/ s表示子目录示例显示所有.log文件:dir * .log / s
— SwiftOnSecurity (@SwiftOnSecurity) April 30, 2018
-SwiftOnSecurity(@SwiftOnSecurity) 2018年4月30日
You can use this trick to search any drive and will usually finish in a few seconds. In the screenshot above, for example, I searched my drive for all files that include “justinpot” in the name by running dir \*justinpot* /s
. Swift, in the tweet, searched for all log files on a drive by running dir \*.log /s
.
您可以使用此技巧搜索任何驱动器,并且通常会在几秒钟内完成。 例如,在上面的屏幕截图中,我通过运行dir \*justinpot* /s
在驱动器中搜索名称中包含“ justinpot”的所有文件。 Swift在推文中通过运行dir \*.log /s
搜索驱动器上的所有日志文件。
Confused? Let’s break this down:
困惑? 让我们分解一下:
dir
is a command used to show files in the current directory, but which can also show files anywhere in the system.dir
是用于显示当前目录中文件的命令,但它也可以显示系统中任何位置的文件。The backslash tells
dir
to search from the root directory of the current drive.反斜杠告诉
dir
从当前驱动器的根目录中搜索。/s
tellsdir
to search all subdirectories./s
告诉dir
搜索所有子目录。Finally,
*
is used by command line apps as a wildcard. So*.txt
will show you all files that end with “.txt”, whileproject*
will show you all filenames that begin with the word “project”最后,命令行应用程序将
*
用作通配符。 因此*.txt
将显示所有以“ .txt”结尾的文件,而project*
将显示所有以“ project”开头的文件名
Put it all together and you’ve got a quick way to search any drive pretty quickly. Give it a try, but note that this won’t work in PowerShell.
放在一起,您就可以快速找到任何驱动器。 尝试一下,但请注意,这在PowerShell中不起作用。
翻译自: https://www.howtogeek.com/fyi/this-command-prompt-trick-searches-way-faster-than-windows-explorer/
命令提示符打开资源管理器