Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to (recursively) check one of my directories to see which files are XML files. Any pointers would be appreciated.

share|improve this question
up vote 4 down vote accepted
find /path/to/directory -type f -name "*.xml"

Finds all files in the given directory (and all subdirectories) with a name ending with .xml. Use -iname for case insensitive name matching instead.

share|improve this answer
To do this recursively? – Dark Templar Jan 4 '12 at 1:03
@DarkTemplar It already is. – Daniel Beck Jan 4 '12 at 1:03
This is exactly what I needed. Thank you! – Dark Templar Jan 4 '12 at 1:07
@DarkTemplar You're welcome. Btw, find is much more powerful and really handy with many different problems. Check out its man page. – Daniel Beck Jan 4 '12 at 1:09
Aight. Got it ;) – Dark Templar Jan 4 '12 at 1:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.