什么扩展到所有文件在当前目录递归? [英] What expands to all files in current directory recursively?

查看:151
本文介绍了什么扩展到所有文件在当前目录递归?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道 ** / *。EXT 扩展到所有子目录中匹配 *所有文件。EXT ,但什么是类似的扩张,包括在所有这些文件中的电流的目录中呢?

I know **/*.ext expands to all files in all subdirectories matching *.ext, but what is a similar expansion that includes all such files in the current directory as well?

推荐答案

这将在4猛砸工作:

ls -l {,**/}*.ext

为了为双星号水珠工作, globstar 选项需要设置(默认值:开启):

In order for the double-asterisk glob to work, the globstar option needs to be set (default: on):

shopt -s globstar

男人庆典


    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.

这篇关于什么扩展到所有文件在当前目录递归?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆