Is there a Windows command-line utility to list largest files exceeding specific size in sub-directories?
Solution 1:
forfiles /P D:\ /M *.* /S /D +"01/17/2012" /C "cmd /c if @fsize gtr 209715200 echo @path @fsize @fdate @ftime"
will scan D:\ and its sub-directories, look for all files whose last modified dates are greater than "17-JAN-2012" and whose sizes are greater than or equal to 200MB, then print their details.
forfiles is included on some Windows Servers, but not by default on Windows XP. You can extract it from the "Windows Server 2003 Resource Kit" download at http://www.microsoft.com/download/en/details.aspx?id=17657 (althou it says is for Windows Server, it runs on Win XP without problems).
Solution 2:
This sounds like a job for PowerShell's
get-childitem
Navigate to the directory in question, check properties with:
get-childitem | get-member
length and FullName look interesting, for example:
get-childitem |ft fullname, length -auto
Once you have mastered the basics try filtering with a where statement.
get-childitem | where-object {$_.length -gt 10000} |ft fullname, length -auto
Experiment with 100000
Solution 3:
The Linux utilities port at UnxUtils contains the Linux find command.
You should rename find.exe to something else, example xfind.exe, as find is a built-in function in the Windows Command Prompt. You can then find all file larger then 1000000 bytes by:
xfind directory -size +1000000 -print
Here is the doc for the Linux command find, but I do not know how exactly it was implemented in UnxUtils and for which version of find.
Solution 4:
Take Command Console LE (which I end up recommending a lot recently), a free replacement for cmd.exe with a lot of extra features, has a command for that: PDIR
pdir /s /(fpn z) /[s10485760,]
-
/s
means recursively, run the command from the directory you want to search. -
/(fpn z)
is the format for displaying the results, here:fullpathfullname size
-
/[s10485760,]
means size = 10 MB or bigger