How to Search for Files Recursively into Subdirectories
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.
Try using Find
sudo find . -print | grep -i '.*[.]xml'
Try this command:
ls -R | grep '.*[.]xml'
ls
doesn't have options to filter the output. For that you would need to use pipe. This passes the output from ls
to grep
, which then filters them to show just the .xml
files.