How to Find Large Files using Command Line in Windows 10

There can be various reasons to search for large files on Windows computers. The primary reason being, freeing up some hard-disk space. One can find such files that are not useful and take appropriate action. The command prompt is the easiest and fastest way to find large files in between 1 MB to 100 GB on hard-drive.

I have guided how to search for files larger than 1 MB to 1 GB on your Windows system. Apart from this, I have also mention another method to find large files on your Windows 10 or older versions.

Using Command Prompt to Find Large Files

If you don’t want to go this step-by-step instruction, then I have prepared a video that will guide how to find large files in Windows using command line:

Or, you may go through below steps using Command line in order to find large files in Windows 10 or older version:

1) Click on Windows Logo, and type CMD  

2) Click on Run as Administrator located on left-hand-side

3) Choose Yes, if pop-up windows appear

4) In the Command Prompt, type following and press Enter key:

forfiles /S /M * /C "cmd /c if @fsize GEQ size in binary bytes echo @path"

Please note that you will have to replace “size in binary bytes” to the size.

This command can be used to find files larger in size than a particular value just by specifying the required value to be compared for the file size attribute.

  • Here, forfiles is a built-in command that selects a file(s) and executes a command on that file
  • /S is a switch that makes for files search every subdirectory
  • /M * /C enables the command for every file under each subdirectory
  • cmd /c is used to run the command:

if @fsize GEQ size in binary bytes echo @path

and terminate after the completion

  • If is a console command that builds conditional branches
  • @fsize denotes file size in bytes
  • GEQ is a comparison parameter which denotes ‘greater than or equal to’. Alternatively, ‘GTR’ can also be used which denotes ‘greater than’
  • size in binary bytes is the value of the size of the file for comparison in binary bytes.
  • Echo is a command that gives the output of the strings passed as its arguments
  • @path is the command that returns the full path of the file. Some other attributes can also be used instead or in addition with a space:

@file :Returns the name of the file

@fname :Returns the file name without extension

@ext :Returns only the extension of the file

@fsize :Returns the size of the file (in bytes)

@fdate :Returns the last modified date of the file

@ftime: Returns the last modified time of the file

@isdir : Checks if the file type is a directory and returns ‘TRUE’ if it is a directory and ‘False’ if it is not.

To understand the aforementioned command better, let us see a few examples:

Example 1 – if you would like to to find files that are 1 MB or more, then type the following command and press Enter:

forfiles /S /M * /C "cmd /c if @fsize GEQ 1048576 echo @path"

Command Line to find files size Greater than

This command will search all subdirectories and their files under the current folder with file size greater than or equal to 1MB and return the complete path of the file(s) as output.

Example 2 – On similar lines, the command to find files having size more than 100 MB would be:

forfiles /S /M * /C "cmd /c if @fsize GTR 104857600 echo @path"

Example 3 – The command to find files having size more than 1 GB would be:

forfiles /S /M * /C "cmd /c if @fsize GTR 1073741824 echo @path"

Once the results of the command appear, close the command prompt.

Find Files Using File Explorer

If you don’t want to use Command Prompt to find files then you may use the File Explorer option.

1) Go to Start menu, type Show hidden and click on it

Show hidden files

2)Now, click on Show settings besides “Change settings to show hidden and system files”

File Explorer settings in Windows 10

3) Go to View tab and check the circle beside Show hidden files, folders, and drives

Show hidden files settings in Windows 10

4) Click on Apply and then on OK

5) Click on This PC in the system tray to open File Explorer

6)  Open the drive, folder or sub-folder where you want to browse the files according to their size

7) Click on the search field on the top right corner

8) Type size: and a drop-down menu will appear to select the file size

Find file using size in file explorer

  • Empty (0 KB)
  • Tiny (0 – 16KB)
  • Small (16 KB – 1 MB)
  • Medium (1 – 128 MB)
  • Large (128 MB – 1 GB)
  • Huge (1 – 4 GB)
  • Gigantic (>4GB)

9) Click on the size category for filtering all the files in that location and displaying the ones you are searching for, according to the size.

For example, if you click on Large, File Explorer will automatically display all files that are 128 MB to 1 GB in size. Similarly, if you click on Gigantic, files that are greater than 4 GB will be displayed.

10) Once the searched files appear, right-click on a blank space and select Sort by >Size>Descending. This will display the largest to smallest sized files in order.

Another Method to Display Files via custom file filtering

1) Open File explorer

2) Click on the search bar and type select size:

3) Then type the “>“or “<” symbols according to the search you want to perform.

For example if you want to find all files with size larger 300 MB, type size: >300MB. Similarly, if you want to find files of sizes between 1 GB to 3 GB, you can type size:>1GB<3GB.

nv-author-image

Leave a Reply

Your email address will not be published. Required fields are marked *