初来贵地,一事请教,发在新手园地里吧
目录结构:
[root@cms test]# ls -R
.:
dir1 dir11 lo test
./dir1:
test test7 test8 test9
./dir11:
test test11 test222 test3333
然后打开了set -x模式 执行命令和结果: [root@cms test]# find ./ -name test?
+ find ./ -name 'test?'
./dir1/test7
./dir1/test8
./dir1/test9
[root@cms test]# find ./ -name test\?
+ find ./ -name 'test?'
./dir1/test7
./dir1/test8
./dir1/test9
[root@cms test]# find ./ -name test*
+ find ./ -name test
./test
./dir11/test
./dir1/test
[root@cms test]# find ./ -name test\*
+ find ./ -name 'test*'
./test
./dir11/test
./dir11/test222
./dir11/test3333
./dir11/test11
./dir1/test
./dir1/test7
./dir1/test8
./dir1/test9
此处的?和*都是通配符吧,那为什么'?'在使用转义符'\'后的结果都可以成功转义而使得输出结果一样,而'*'不可以呢?而且搜索了相关内容,说得都是如果没有进行转义,那么find的应该是‘test*’这个字符串,而实际find却是‘test’呢? |