File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -737,7 +737,7 @@ $ ls /windows/program*
737
737
738
738
** (6)globstar 参数**
739
739
740
- ` globstar` 参数可以使得` ** ` 表示零个或多个子目录 。该参数默认是关闭的。
740
+ ` globstar` 参数可以使得` ** ` 匹配零个或多个子目录 。该参数默认是关闭的。
741
741
742
742
假设有下面的文件结构。
743
743
@@ -747,7 +747,7 @@ sub1/b.txt
747
747
sub1/sub2/c.txt
748
748
` ` `
749
749
750
- 上面的文件结构中,顶层目录、第一级子目录、第二级子目录里面各有一个文本文件 。请问怎样才能使用通配符,将它们显示出来?
750
+ 上面的文件结构中,顶层目录、第一级子目录` sub1 ` 、第二级子目录 ` sub1 \s ub2 ` 里面各有一个文本文件 。请问怎样才能使用通配符,将它们显示出来?
751
751
752
752
默认情况下,只能写成下面这样。
753
753
@@ -756,9 +756,9 @@ $ ls *.txt */*.txt */*/*.txt
756
756
a.txt sub1/b.txt sub1/sub2/c.txt
757
757
` ` `
758
758
759
- 这是因为` * ` 只匹配当前目录,如果要匹配子目录,只能把它一层层写出来 。
759
+ 这是因为` * ` 只匹配当前目录,如果要匹配子目录,只能一层层写出来 。
760
760
761
- 打开` globstar` 参数以后,` ** ` 就匹配零个或多个子目录 。因此,` ** /* .txt` 就可以得到想要的结果。
761
+ 打开` globstar` 参数以后,` ** ` 匹配零个或多个子目录 。因此,` ** /* .txt` 就可以得到想要的结果。
762
762
763
763
` ` ` bash
764
764
$ shopt -s globstar
You can’t perform that action at this time.
0 commit comments