bash – 什么扩展到当前目录中的所有文件?

前端之家收集整理的这篇文章主要介绍了bash – 什么扩展到当前目录中的所有文件?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我知道** / *。ext扩展到匹配* .ext的所有子目录中的所有文件,但是什么是类似的扩展,包括当前目录中的所有这些文件
这将工作在Bash 4:
ls -l {,**/}*.ext

为了使双星号glob工作,需要设置globstar选项(默认:on):

shopt -s globstar

从人bash:

    globstar
                  If set,the pattern ** used in a filename expansion con‐
                  text will match a files and zero or more directories and
                  subdirectories.  If the pattern is followed by a /,only
                  directories and subdirectories match.
原文链接:https://www.f2er.com/bash/391618.html

猜你在找的Bash相关文章