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
  • 4,222
  • 13
  • 48
  • 74

2 Answers2

28

You can use find command:

find . -type f -name '*.xml'
kev
  • 155,172
  • 47
  • 273
  • 272
2

Since you tagged the question with bash:

shopt -s extglob globstar
ls !(exclude.this.dir)/**/*.xml
glenn jackman
  • 238,783
  • 38
  • 220
  • 352