我不明白??
和*
一起使用时的执行情况。在Linux中执行ls命令
以下文件是在当前工作目录:
的abc.txt
abcd.txt
bcd.txt
amm.doc
ammc.txt
什么是执行命令后的返回结果ls a??.*
我不明白??
和*
一起使用时的执行情况。在Linux中执行ls命令
以下文件是在当前工作目录:
的abc.txt
abcd.txt
bcd.txt
amm.doc
ammc.txt
什么是执行命令后的返回结果ls a??.*
* Matches any string, including the null string (empty string)
? Matches any single character
对于exemples
Pattern a??.* matches abc.txt
- (A,A)
- (,B)
- (?,C)
- (。,。)
- ( *,TXT)
Pattern a??.* don't matches abcd.txt
- (A,A)
- (?,b)
- (?,c)
- 但是。 dont'与d匹配
Pattern a??.* don't matches bcd.txt because a don't matches with b.
问题标记将转换为任何一个字符,但*会转换为多个字符。你的例子只会产生abc.txt和amm.doc。如果你想了解更多信息,请查阅Shell Globbing。
你是什么意思“什么是返回结果”?当你尝试时发生了什么? – Gary
在这种模式下,通配符相当直观。当你在它们之间移除'.'时会变得复杂,或者在'*'之后有'?'。 – Thilo