For some reason, I always seem to be looking for file and directory names. Since desktop search is a GUI and I’m a command line kind of guy, I got tired of waiting on PowerShell to slowly grind through the file system on its single thread. With lots of cores and an SSD, I shouldn’t be waiting on simple file finds! On a plane trip I threw together this command line tool to speed up my file finding and give me an extra five seconds each day I used to spend waiting on file searches to finish. This little program scratched my itch and maybe someone will find it useful.
You can search with wild cards as well as regular expressions and for as many patterns as you want. It will also handle directory names if you want. Yes, it’s a full featured fast file finder. Here are all the command line flags and usage instructions:
Usage:
FF [-regex] [-includedir] [-nostats] [-path <directory>] pattern*
-regex – Treat the patterns as regular expressions. The default
follows DOS wildcard usage. Make sure to use regex values
in patterns with this flag. (short: -re)
-includedir – Include directory names when searching for matches. The
default is only to look at the file name. (short: -i)
-nostats – Don’t show the search statistics at the end. Useful when
you just want the list of matching files. (short: -ns)
-path <directory> – The directory tree to search. The default is the current
directory. (short: -p)
pattern* – The patterns/files to search for. Specify as many patterns
as you want separated by spaces. Enclose patterns/files in
quotes to use spaces in the pattern or name.
Examples:
– Search the current directory tree for all .CMD files
ff *.cmd
– Search the Windows directory for all log and txt files
ff -p c:windows *.log *.txt
Like all Wintellect open source, you can grab it at our GitHub page: http://code.training.atmosera.com or directly at the Fast File Finder repository: https://github.com/Wintellect/FastFileFinder.
Cloud management is difficult to do manually, especially if you work with multiple cloud…
Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…
https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…
FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…
Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…
In the intricate landscape of modern business, compliance is both a cornerstone of operational integrity…
View Comments
Wonder if this could be done with multiple threads as a binary PowerShell cmdlet? I had put together a simple script that mimics basic use of the find command in unix but performance left a lot to be desired. However, the usefulness of having FileInfo objects piped out is worth it.
Josh,
Your idea should work. Basically instead of dumping out the file names, cache up the FileInfo items and pump them back to PowerShell. Feel free to make it happen! :)
- John Robbins
Neat! Looks very handy. Personally, though, whenever I use a computer one of the first thing I do is install Everything (http://www.voidtools.com/), the GUI interface and automatic Copy/Paste are great.
Interesting Finds: January 28, 2013
We found that the .NET GetFiles(string, string) method is very slow, especially when searching directories with 10's of thousands of files. We got an order of magnitude increase is speed by interop-ing with the old Win32 FindFirst, FindNext methods.
If you want almost instantaneous file/folder search, use Everything (voidtools.com), and there is a command line version too. Free, incredibly quick to respond and index a folder, I use it from many years and I just can't work (I'm a developer) without it !