How to Find Modified Files with FC, COMP, and FINDSTR in Windows CMD: Complete Guide

Last update: 09/05/2025
Author Isaac
  • El CMD de Windows offers advanced tools such as FC, COMP and FINDSTR to efficiently locate and analyze modified files.
  • Commandos such as FORFILES and DIR allow you to filter files based on the modification date and automate management processes.
  • Using batch scripts and tools like EaseUS Dupfiles Cleaner makes it easy to identify and remove duplicate or unnecessary files.

Find modified files in CMD

Finding recently modified files in Windows can be quite a challenge if you're not familiar with the command prompt. Many users are unaware of how much the system's built-in commands can facilitate file management and searches, especially when it comes to locating recent changes or comparing content across multiple documents. Fortunately, powerful tools like FC , COMP , and FINDSTR exist in the Windows Command Prompt, which, when combined effectively, allow you to locate and analyze modified files efficiently and with great versatility.

In this article, we'll break down in detail how to use these commands to find modified files, compare sets of documents, and filter specific results. We'll also explore alternatives and best practices for getting the most out of the command prompt, whether you're looking for something quick or have advanced needs. Get ready to discover the full potential of the Command Prompt in Windows!

CMD in Windows: An essential ally for finding and managing modified files

The command prompt, commonly known as CMD, is a powerful tool included in all versions of Windows. Its main purpose is to provide an environment for executing commands to manage files and systems in an advanced way. Despite the existence of graphical wizards, CMD remains the undisputed leader for automated searches, date filtering, and comparisons between files or folders.

For users who manage large volumes of files, maintaining control over modified documents is vital. For example, if you share files with other users, program scripts, or simply want to make efficient backups, you'll need to locate only the files that have actually changed in a specific period.

Before diving into the commands, it's worth remembering that you can open CMD as a regular user or as an administrator (recommended if you're working in protected folders). Simply search for "cmd" in the Start menu, right-click, and select "Run as administrator."

Once the console is open, let's review the most efficient options for searching and comparing modified files.

  How to Get All Your Photos from iCloud on Mac

Find modified files with the FINDSTR, FC, and COMP commands

When we want to locate modified files, it's helpful to know the most basic tools and their capabilities. The FC , COMP , and FINDSTR commands stand out for their power and flexibility.

  • FC: Compares the contents of two files or sets of files and displays the differences. Works for both text and binary files.
  • COMP: Allows you to compare two files or sets of files byte by byte and highlight the changes.
  • FINDSTR: Filters lines of text in files based on specific patterns, even using regular expressions.

Let's take a closer look at how they are used to meet different needs.

FINDSTR Command: Advanced Text Search in Files

The FINDSTR command is one of the most versatile for locating information within files. Its greatest strength is its ability to search for patterns, either literally or as regular expressions, allowing it to capture all kinds of matches.

Basic syntax:

findstr "patrón" archivo(s)

In its basic operation, FINDSTR searches for the text we specify in one or more files, returning the lines that meet the criteria.

Key parameters:

  • /s: Searches the current directory and all its subdirectories (very useful for recursive searches).
  • /i: Ignores case.
  • /n: Displays the line number of each match.
  • /m: Shows only the name of files that contain matches, not the lines.
  • /r: Allows you to use regular expressions.
  • /c:»text»: Search for the complete literal string.
  • /f:file: Gets the list of files from a text file.

For example, if you need to find all files containing the word "modified" in any subfolder, the command would be:

findstr /s /i modificado *.*

Regular expressions allow you to expand your searches. For example, to find files containing words beginning with "comp," you could use:

findstr /s /i /m \<comp.* *.*

Tip: If you're searching in binary or large files, add /p to skip those with non-printable characters.

Compare Files with FC: Easily Locate Modifications

The FC command is designed to compare the contents of two files or sets of files and show exactly how they differ. This is essential if you want to know what has changed between versions of a document, or detect changes in logs , scripts, or any configuration file.

Basic syntax:

fc archivo1 archivo2

Featured Options:

  • /A: Show only the first and last lines of each difference group.
  • /B: Performs comparison in binary mode.
  • /C: Ignores case differences.
  • /L: Compares files as ASCII text.
  • /N: Displays line numbers in ASCII differences.
  How to give Ubuntu the macOS look and feel step by step

A practical example for comparing two text files ignoring case differences would be:

fc /c archivo1.txt archivo2.txt

If you need to compare two sets of files (for example, two folders with configuration files), you can do so using variables or batch scripts to automate the process and return only the files that have changed.

Detect files modified by date with FORFILES and alternatives

Although FINDSTR and FC are powerful tools for analyzing file content, if you're looking to identify files that have been modified within a specific date range, the ideal solution is to use the FORFILES command , which allows filtering by last modification date.

forfiles /p "directorio" /s /d +yyyy-mm-dd /c "cmd /c echo @path"

For example, to find files modified in the last 7 days in the current directory and subdirectories, you could use:

forfiles /s /d -7 /c "cmd /c echo @file"

Recover Deleted Files on Windows PC and Hard Drives
Related articles:
How to Recover Deleted Files on Windows PC and Hard Drives for Free

Tip: You can combine this output with other commands (such as FINDSTR or FC) to detect specific changes or compare only recently modified files. This becomes very powerful when automated in batch scripts.

Filter results with FIND and other classic utilities

In the Windows console, there are other commands that can help you search for files or patterns in the content. One of the classics is FIND , although its functionality is more limited than FINDSTR.

find "texto" archivo.txt

FIND only searches for literal text in files and is less flexible, but may be sufficient for quick searches or for filtering results to specific lines.

For more advanced tasks, the FINDSTR + DIR combination allows you to search for modified files and then filter by content. For example, if you first use DIR to list files by date, you can then route the list to FINDSTR to search for specific names.

Searching by Date and Name on Unix and Linux Systems: A Quick Review

Although the primary focus is Windows, many users search both systems. In Unix/Linux, the `find` command is essential for locating modified files.

  • For days: find . -mtime -2 displays files modified in the last two days in the current directory and subdirectories.
  • Per minute: find . -mmin -120 displays files modified in the last 120 minutes.
  • By range of days: find . -mtime +30 -mtime -40 files modified between 30 and 40 days ago.
  • By type and name: find . -type f -mtime -7 -name "*.MID" locates files with the MID extension modified in the last week.
  Complete Guide to Configuring 4K and 60 FPS Export in CapCut

Windows does not have the Linux "find" command , but combinations of DIR, FORFILES, FINDSTR and batch scripts can be used to achieve similar results.

Delete and clean modified or duplicate files

Once you've located the modified or duplicate files, you might also want to delete them. The DEL command is the most direct way to delete files from CMD:

del /s /f "nombre-archivo"

/s : deletes files in the current directory and subfolders, /f : forces the deletion of files with read-only attributes. If you want to clean up empty directories, you can use:

rmdir /s /q nombre-directorio

Be very careful when using these commands, as there is no recycle bin in CMD. Once deleted, files cannot be easily recovered.

Complementary commands and productivity tips

In addition to the commands already mentioned, there are other utilities that can make your work much easier:

  • DIR: Perfect for listing files sorted by date and size.
  • ATTRIB: Displays or changes attributes of files and folders.
  • ICACLS: Allows you to manage file and folder permissions, useful for identifying why you cannot access or modify specific files.
  • Using batch scripts: You can combine multiple commands in .bat or .cmd files to automate search and comparison processes.

For example, you can create a script that searches for all files with a certain extension that have been modified in the last 3 days and compares them against backups, notifying only of relevant changes.

How to Search for Files in Windows 10 by Specific Date Ranges
Related articles:
How to Search for Files in Windows 10 by Specific Date Ranges