File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -737,7 +737,7 @@ $ ls /windows/program*
737737
738738** (6)globstar 参数**
739739
740- ` globstar` 参数可以使得` ** ` 表示零个或多个子目录 。该参数默认是关闭的。
740+ ` globstar` 参数可以使得` ** ` 匹配零个或多个子目录 。该参数默认是关闭的。
741741
742742假设有下面的文件结构。
743743
@@ -747,7 +747,7 @@ sub1/b.txt
747747sub1/sub2/c.txt
748748` ` `
749749
750- 上面的文件结构中,顶层目录、第一级子目录、第二级子目录里面各有一个文本文件 。请问怎样才能使用通配符,将它们显示出来?
750+ 上面的文件结构中,顶层目录、第一级子目录` sub1 ` 、第二级子目录 ` sub1 \s ub2 ` 里面各有一个文本文件 。请问怎样才能使用通配符,将它们显示出来?
751751
752752默认情况下,只能写成下面这样。
753753
@@ -756,9 +756,9 @@ $ ls *.txt */*.txt */*/*.txt
756756a.txt sub1/b.txt sub1/sub2/c.txt
757757` ` `
758758
759- 这是因为` * ` 只匹配当前目录,如果要匹配子目录,只能把它一层层写出来 。
759+ 这是因为` * ` 只匹配当前目录,如果要匹配子目录,只能一层层写出来 。
760760
761- 打开` globstar` 参数以后,` ** ` 就匹配零个或多个子目录 。因此,` ** /* .txt` 就可以得到想要的结果。
761+ 打开` globstar` 参数以后,` ** ` 匹配零个或多个子目录 。因此,` ** /* .txt` 就可以得到想要的结果。
762762
763763` ` ` bash
764764$ shopt -s globstar
You can’t perform that action at this time.
0 commit comments