Recursively search for files

Recursively finds all instances of files and folders with a naming pattern


Updated Thu, 01 Sep 2016 15:35:21 +0000

View License

Returns a list of all files matching a given pattern (*.m, *.mat, data*.xls*, etc) that live anywhere in or below a given starting folder.
For example, >> files = findfiles('*.mat','C:\myfolder'); will find C:\myfolder\foo.mat, C:\myfolder\data.mat, C:\myfolder\mydata\data.mat, etc.

Cite As

Matt Tearle (2023). Recursively search for files (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2016a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on File Operations in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Updated license