Efficiently Building Directory Listings

Soldato
Joined
25 Oct 2002
Posts
2,628
I have a file share with multiple millions of directories and tens of millions of files. I would like to to identify the paths to all files of a particular type but I'm not sure of the most efficient way of doing this.

At the most basic level I could use Powershell and recursively work from the top to the bottom with something like this, but I have no idea how it would behave over such a large structure.

Code:
get-childitem -force -recurse -filter "*.doc" | Select Name, FullName | Export-Csv dir.txt -Encoding ascii -NoTypeInformation

Does anyone have any experience or recommendations as to how to approach this?
 

Deleted member 138126

D

Deleted member 138126

Why not just test it? It should just chug away in the background.
 
Associate
Joined
3 Oct 2007
Posts
795
The method LizardKing gives is probably the simplest way to do what you're asking.
dir is perfect for a basic report, not so good if you want a nicely formatted csv - It depends what purpose the data is being put to, are there other details you require like filesize, owner, etc?
 
Back
Top Bottom