How to Search Files using CMD in Windows(Step-by-Step Guide)
Last Updated :
26 Jun, 2025
Have you ever lost an important file and found yourself clicking through countless folders trying to find it? The Windows Command Prompt (CMD) is a powerful built-in tool that helps you locate files quickly—without needing any third-party software. In this article, you’ll learn how to use CMD commands to search for files by name, extension, and more in Windows 10 and 11.
So without further ado, let's get into the process of finding files using CMD in Windows 10 and well in Windows 11.
How to Find Files Using CMD in Windows(10 & 11)?
In this section we have mentioned some steps, so follow the few steps to get the lost file or file that you are looking for.
Step 1: Open CMD
- To find your file first, open CMD or Windows Command Prompt, and to do this, click the Win+R button and type CMD, or you can click the Windows key and type CMD to open Windows Command Prompt.
Step 2: Use DIR Command
- After successfully launching the Command Prompt, type the below command and press Enter to pull up a list of files and folders.
dir

Step 2: Use CD Folder Command
- For moving down into a particular directory, use the below command followed by a folder name, until you reach the folder you want to search.
cd folder_name
Step 3: Use Aging DIR Command
- Now type the dir command again but this time with your search term, follow dir with your search term in quotes with an asterisk term before closing the quotes (For example, type dir “Raveling*”) and press Enter. The command prompt will show you the file location along with the list of files name starting with a similar keyword.

- The asterisk is what’s known as a wildcard and, in our example, it stands for anything that follows the word ‘highlands’, such as ‘raveling.doc’, ‘raveling.xls’ or My Business plans.txt’.
- If you don’t know the exact location of your file in your hard drive, then instead of manually navigating through your directories, start searching from the very top level of your hard drive and include every sub-folder.
Step 4: Use Raveling Command
- The top level of the drive is represented by a backslash and, to include subdirectories, you add a forward slash and ‘s’ to the end of the query as shown below:
dir “\Raveling*” /s

- The above command is my all-time favorite because, with the help of this command, I don’t have to force my brain to remember the location of the files. This trick usually takes seconds to search the entire drive for the file.
- You can also search for a particular file type by using a command dir \*.pdf /s and it will show you all files saved with the .pdf extension. You can try this for other files too (for example: .doxc, .png, .exe and more).

Note: The position asterisk symbol in the command matters a lot so type carefully and check once before executing the command.
How All The Commands Works?
Now you know enough to find any file on your entire hard drive within few seconds but if you are more curious to know how all these commands are working and what all these symbols stand for, then continue reading this post.
Let’s discuss each term one by one:
- dir command is for showing files on the current directory, but it can also show files from anywhere in the drive of the system.
- / tells dir to search from the top-level or root directory of the hard drive.
- /s is used for searching sub-directories.
- * asterisk is using before text (for example *.pdf) show all files ending with .pdf and * using at the end (for example raveling*) show you all file-names starting with that word.
Conclusion
Using the Command Prompt to search files in CMD is a valuable skill for anyone who frequently navigates through files and directories on a Windows system. By understanding the various commands available, you can easily find files with CMD and streamline your workflow. Whether you're searching by name, location, or content, this method ensures that you can quickly locate the files you need with minimal effort.
Similar Reads
How to Merge/Hide One File into Another Using CMD in Windows? Merging or hiding files within other files using Command Prompt in Windows is a clever technique for managing and protecting your data. Whether you want to consolidate multiple files into one or conceal sensitive information, CMD offers powerful commands to achieve this seamlessly. Learning how to h
4 min read
How to Hide files using Command-line Interface? If you're looking to hide files using the command line, it's a quick and efficient way to protect sensitive data on your system. Whether on Windows, macOS, or Linux, you can use the command line to hide files or folders with just a few simple commands. This guide will help you understand how to hide
3 min read
How to List all Files in a Directory using CMD in Windows Are your files buried deep in folders and hard to find? While File Explorer is good for browsing visually, the Windows Command Prompt (CMD) offers a faster and more powerful way to manage and list files. Whether you're troubleshooting, creating backup lists, or writing scripts, the dir command gives
5 min read
How to Automate Disk Cleanup Using Task Scheduler in Windows? To keep your Windows system operating at its best, you must remove any superfluous files from it. Using Task Scheduler to automate disk cleanup is one of the simplest ways to make sure it happens regularly. By automating this repetitive task, you may avoid manually cleaning your computer and save ti
4 min read
How to use CMD for Python in Windows 10 Want to run Python programs directly from the Command Prompt? This guide will walk you through how to run Python in CMD, configure the environment, and troubleshoot common issues. By mastering these steps, youâll streamline your development process and save time during testing.Steps to Use CMD for P
4 min read