2016-10-29 157 views
1

我不明白??*一起使用時的執行情況。在Linux中執行ls命令

以下文件是在當前工作目錄:

的abc.txt
abcd.txt
bcd.txt
amm.doc
ammc.txt

什麼是執行命令後的返回結果ls a??.*

+1

你是什麼意思「什麼是返回結果」?當你嘗試時發生了什麼? – Gary

+0

在這種模式下,通配符相當直觀。當你在它們之間移除'.'時會變得複雜,或者在'*'之後有'?'。 – Thilo

回答

0
* 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. 
0

問題標記將轉換爲任何一個字符,但*會轉換爲多個字符。你的例子只會產生abc.txt和amm.doc。如果你想了解更多信息,請查閱Shell Globbing。