列出目录和子目录中的所有XML文件(list all xml files within a dire

2019-09-18 03:23发布

我想列出一个目录及其子目录的所有.xml文件。 我想LS-LR,但无法从.XML除了过滤掉其他文件..

我想是这样的LS-LR | grep的的* .xml。

谢谢!

Answer 1:

您可以使用find命令:

find . -type f -name '*.xml'


Answer 2:

由于您标记使用bash的问题:

shopt -s extglob globstar
ls !(exclude.this.dir)/**/*.xml


文章来源: list all xml files within a directory and subdirectory
标签: linux bash