Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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
1  
@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

 
discard

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.