2

I want to list all .xml files in a dir and its subdir. I tried ls -LR but not able to filter out other files apart from .xml..

I want something like ls -LR | grep *.xml .

Thanks!

user1164061
  • 3,982
  • 12
  • 45
  • 70

2 Answers2

26

You can use find command:

find . -type f -name '*.xml'
kev
  • 146,428
  • 41
  • 264
  • 265
2

Since you tagged the question with bash:

shopt -s extglob globstar
ls !(exclude.this.dir)/**/*.xml
glenn jackman
  • 223,850
  • 36
  • 205
  • 328