Searching for a file in Windows Explorer takes forever, but there’s a faster way if you’re willing to use the command prompt.
The amazing Twitter account SwiftOnSecurity posted this gem yesterday:
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.
1.) dir "search term*" /s
means start from root and /s means subdirectories
Example shows all .log files:
dir *.log /s— SwiftOnSecurity (@SwiftOnSecurity) April 30, 2018
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
.
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.- The backslash tells
dir
to search from the root directory of the current drive. /s
tellsdir
to search all subdirectories.- 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”
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.
- › It’s Okay to Skimp on These 10 Tech Products
- › Keychron Q8 Mechanical Keyboard Review: An Advanced Keyboard for All Uses
- › 10 Awesome iPad Features You Should Be Using
- › Shift+Enter Is a Secret Shortcut Everyone Should Know
- › Lenovo ThinkPad Z13 Gen 1 Review: A Vegan Leather Laptop That Means Business
- › 10 Hidden Android 13 Features You Might Have Missed