diff --git a/quests/tab/Dockerfile b/quests/tab/Dockerfile new file mode 100644 index 0000000..1811d6e --- /dev/null +++ b/quests/tab/Dockerfile @@ -0,0 +1,3 @@ +FROM linuxodyssey/quest-base + +COPY home ${HOME} diff --git a/quests/tab/game.yml b/quests/tab/game.yml new file mode 100644 index 0000000..f269197 --- /dev/null +++ b/quests/tab/game.yml @@ -0,0 +1,38 @@ +title: Tab 自動補全 +instruction: | + 在這個關卡,你將會學到 + + 1. 如何使用 Tab 自動補全路徑 + 2. 出現衝突時如何處理 + + 按下中間的按鈕來開始這個關卡。 + +requirements: + - read + +stages: + - id: start + task: 按下開始按鈕開始關卡 + condition: + command: + - ^echo start$ + responses: + - content: | + 在終端機裡,所有的操作都是用文字進行。 + 然而,打字很花時間,而且只要一個字打錯,指令就會執行失敗。 + 因些終端機提供「自動補全」的功能,自動幫你完成檔案路徑、指令名稱、參數名稱,節省你的時間,也避免輸入錯誤。 + + 在開始練習之前,我們先來看看家目錄下有哪些檔案。 + + hints: + - ➤ 使用 `ls` 查看檔案列表 + + - id: ls + task: 使用 `ls` 查看檔案列表 + requirements: + - start + condition: + command: + - ^never$ + responses: + - content: | diff --git a/quests/tab/home/SuperSecretPlansForWorldDomination.txt b/quests/tab/home/SuperSecretPlansForWorldDomination.txt new file mode 100644 index 0000000..3ef2e2f --- /dev/null +++ b/quests/tab/home/SuperSecretPlansForWorldDomination.txt @@ -0,0 +1,10 @@ +1. 收集全世界的襪子,讓所有人都找不到另一支襪子。 +2. 訓練一支企鵝軍隊,用可愛征服世界。 +3. 發明一種能讓所有人講話都變成雞叫聲的裝置。 +4. 把所有的咖啡替換成無咖啡因的,看著世界陷入混亂。 +5. 用巨大的橡皮擦擦掉所有國家的邊界,宣布地球是一個巨大的遊樂場。 +6. 讓所有政治家在演講時必須穿著小丑服裝。 +7. 把所有的數學課本改成烹飪食譜,看看會發生什麼。 +8. 發明一種能讓人說出真心話的香水,然後在聯合國大會上噴灑。 +9. 用巨大的磁鐵吸走地球上所有的金屬,建造一個太空迪士尼樂園。 +10. 最後,如果以上都失敗了,就用可愛貓咪影片轟炸全世界的社交媒體,直到所有人都投降為止。 diff --git a/quests/tab/home/ThingsIWillOrganizeLaterWhenIHaveTime/HowToProperlyMakeASandwich.txt b/quests/tab/home/ThingsIWillOrganizeLaterWhenIHaveTime/HowToProperlyMakeASandwich.txt new file mode 100644 index 0000000..e69de29 diff --git a/quests/tab/home/ThingsIWillOrganizeLaterWhenIHaveTime/RandomStuffThatIDownloadedAt3AM.txt b/quests/tab/home/ThingsIWillOrganizeLaterWhenIHaveTime/RandomStuffThatIDownloadedAt3AM.txt new file mode 100644 index 0000000..35f05fb --- /dev/null +++ b/quests/tab/home/ThingsIWillOrganizeLaterWhenIHaveTime/RandomStuffThatIDownloadedAt3AM.txt @@ -0,0 +1,7 @@ +我在凌晨 3 點開始下載的東西,但我一直沒有時間去整理。 + +1. 一個可以把所有食物變成披薩的魔法棒設計圖 +2. 如何在五分鐘內學會十種外星語言的秘密指南 +3. 用舊襪子製作時尚帽子的教程視頻(連結已失效) + +這些東西有什麼用處? \ No newline at end of file diff --git a/quests/tab/home/ThingsIWillOrganizeLaterWhenIHaveTime/RandomStuffThatIDownloadedAt4AM.txt b/quests/tab/home/ThingsIWillOrganizeLaterWhenIHaveTime/RandomStuffThatIDownloadedAt4AM.txt new file mode 100644 index 0000000..3d8ae08 --- /dev/null +++ b/quests/tab/home/ThingsIWillOrganizeLaterWhenIHaveTime/RandomStuffThatIDownloadedAt4AM.txt @@ -0,0 +1,7 @@ +我在凌晨 4 點開始下載的東西,但我一直沒有時間去整理。 + +1. 一份詳細解釋為什麼貓咪才是地球真正統治者的論文 +2. 如何用口香糖和迴紋針修理國際太空站的WikiHow頁面 +3. 訓練水母成為水下偵探的完整課程大綱 + +這些東西有什麼用處? \ No newline at end of file diff --git a/quests/tab/home/ThsisAFlieNmaeWthAloOfTpyosThatisRleayHdToRaed.txt b/quests/tab/home/ThsisAFlieNmaeWthAloOfTpyosThatisRleayHdToRaed.txt new file mode 100644 index 0000000..e69de29 diff --git a/quests/tab/home/documnt.txt b/quests/tab/home/documnt.txt new file mode 100644 index 0000000..e69de29 diff --git a/quests/tab/home/heIIo.txt b/quests/tab/home/heIIo.txt new file mode 100644 index 0000000..0a26c84 --- /dev/null +++ b/quests/tab/home/heIIo.txt @@ -0,0 +1,2 @@ +你被騙了! +它不是 hello,而是 he "ii" o diff --git a/quests/tab/tab.md b/quests/tab/tab.md new file mode 100644 index 0000000..5320893 --- /dev/null +++ b/quests/tab/tab.md @@ -0,0 +1,48 @@ +# 使用 Tab 自動補全 + +在這個關卡,你將會學到 + +1. 如何使用 Tab 自動補全路徑 +2. 出現衝突時如何處理 + +按下中間的按鈕來開始這個關卡。 + +--- + +在終端機裡,所有的操作都是用文字進行。 +然而,打字很花時間,而且只要一個字打錯,指令就會執行失敗。 +因些終端機提供「自動補全」的功能,自動幫你完成檔案路徑、指令名稱、參數名稱,節省你的時間,也避免輸入錯誤。 + +在開始練習之前,我們先來看看家目錄下有哪些檔案。 + +> 使用 `ls` 查看檔案列表 + +--- + +你看到了這個資料夾中充滿了超級長和有錯字的檔案名稱,如果這些都要我們一個一個字輸入,肯定會很痛苦。 +但不要緊,只要使用自動補全,檔名不論多長都能輕鬆輸入。 + +使用自動補全的方法是,**先輸入部分的檔名,再按下 Tab** +(Tab 是 Q 左邊的按鍵) +例如要補全 `SuperSecretPlansForWorldDomination.txt`,你可以先輸入 `Su` 再按下 Tab,終端機就會幫你打完剩下的檔名了。 + +我們試看看印出 `SuperSecretPlansForWorldDomination.txt` 這個檔案的內容。 + +> 使用 `cat SuperSecretPlansForWorldDomination.txt` 來印出檔案內容 +> 在輸入 `cat Su` 之後按下 Tab 來自動補全檔名,完成後按 Enter 就能執行指令 + +--- + +你看到了終端機自動幫你補全了 `SuperSecretPlansForWorldDomination.txt`,就算是很長的檔名,也不用怕打錯字。 +開頭不論你打了幾個字都無所謂,你可以只打 `S`、`Su`、`Sup`、`Super` 或甚至完全不打字都沒關係。 +但是你打的字越少,就越容易跟其他的檔案重複,這時候就要做衝突處理。 +關於衝突處理,我們會在待會練習。 + +讓我們再練習一個,這次請你查看 `ThingsIWillOrganizeLaterWhenIHaveTime` 資料夾中的檔案。 +一樣,輸入前幾個字,然後按 Tab 自動補全。 + +> 輸入 `ls ThingsIWillOrganizeLaterWhenIHaveTime` 進入到該資料夾 +> 輸入 `ls Thing` 之後按下 Tab 做自動補全 +> 試試看輸入更少的字元就按 Tab 會有什麼樣的結果 + +---