Find File and Directory Names FAST

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:

FF 1.0.0.0
(c) 2012, John Robbins/Wintellect – john@training.atmosera.com
Find file and directory names fast!

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.

John Robbins

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

  • 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 !

Recent Posts

How to Navigate Azure Governance

 Cloud management is difficult to do manually, especially if you work with multiple cloud…

6 days ago

Why Azure’s Scalability is Your Key to Business Growth & Efficiency

Azure’s scalable infrastructure is often cited as one of the primary reasons why it's the…

3 weeks ago

Unlocking the Power of AI in your Software Development Life Cycle (SDLC)

https://www.youtube.com/watch?v=wDzCN0d8SeA Watch our "Unlocking the Power of AI in your Software Development Life Cycle (SDLC)"…

1 month ago

The Role of FinOps in Accelerating Business Innovation

FinOps is a strategic approach to managing cloud costs. It combines financial management best practices…

1 month ago

Azure Kubernetes Security Best Practices

Using Kubernetes with Azure combines the power of Kubernetes container orchestration and the cloud capabilities…

2 months ago

Mastering Compliance: The Definitive Guide to Managed Compliance Services

In the intricate landscape of modern business, compliance is both a cornerstone of operational integrity…

2 months ago