How to Search for Files Recursively into Subdirectories

I am trying to look for all XML files in a particular directory and all sub-directories (recursively) inside it.

ls -R *.xml is only listing files in the current directory. I am quite sure, the sub-folders themselves have several .xml files, but none are showing up.

Is this a configuration issue?


Solution 1:

You can do it with find only:

find . -name '*.xml'

. is the current directory. If you need to search in another directory, replace . with the directory path.

Solution 2:

Try using Find

sudo find . -print | grep -i '.*[.]xml'