This commit is contained in:
Chen, Tai-Lin committed 2024-04-30 01:40:42 +08:00
1 parent c96ee83fa3
commit aebe587ad3
5 files changed
+33 -9

No files matched your search

-1
View File
@@ -1,4 +1,3 @@
FROM linuxodyssey/quest-base FROM linuxodyssey/quest-base
COPY home ${HOME} COPY home ${HOME}
RUN chmod
+33 -8
View File
@@ -31,8 +31,7 @@ stages:
- 請輸入 `echo start` 來開始 - 請輸入 `echo start` 來開始
responses: responses:
- type: narrative - type: narrative
content: content: 現在我們要學習如何查看檔案的存取權限。
現在我們要學習如何查看檔案的存取權限。
使用`ls -l`指令來查看不同檔案的存取權限吧! 使用`ls -l`指令來查看不同檔案的存取權限吧!
hints: hints:
@@ -50,30 +49,56 @@ stages:
responses: responses:
- type: narrative - type: narrative
content: content:
- 你成功查看到檔案的存取權限了!
- 你可以看到檔案的存取權限的左邊類似 `-rw-r--r--` 的字串。 - 你可以看到檔案的存取權限的左邊類似 `-rw-r--r--` 的字串。
- 這個字串由十個字元組成,第一個字元代表檔案的類型,後面九個字元分別代表檔案的存取權限。 - 這個字串由十個字元組成,第一個字元代表檔案的類型,後面九個字元分別代表檔案的存取權限。
- 第一個字元如果是 `-` 代表這是一個檔案,如果是 `d` 代表這是一個資料夾。 - 第一個字元如果是 `-` 代表這是一個檔案,如果是 `d` 代表這是一個資料夾。
- 後面九個字元中以三個字元一組,分別代表檔案的擁有者、群組、以及其他人的存取權限。 - 後面九個字元中以三個字元一組,分別代表檔案的擁有者、群組、以及其他人的存取權限。
- 每一組中的三個字元分別代表讀取(`r`)、寫入(`w`)、執行(`x`)的權限。 - 每一組中的三個字元分別代表讀取(`r`)、寫入(`w`)、執行(`x`)的權限。
- 如果該欄位是 `-` 則表示沒有該權限。 - 如果該欄位是 `-` 則表示沒有該權限。
- 例如 `rw-` 代表擁有讀取和寫入的權限,但沒有執行的權限; - 例如 `-w-` 代表擁有寫入的權限,但沒有讀取和執行的權限;
- 而 `r-x` 代表擁有讀取和執行的權限,但沒有寫入的權限。
- 現在試著查看 `file1` 、 `file2` 、 `file3` 的內容吧!
- 如果沒有權限將會顯示 `Permission denied` 的訊息。
- id: read-file1 - id: read-file1
task: 查看 `file1` 的內容 task: 嘗試查看 `file1` 的內容
requirements: requirements:
- ls-l - ls-l
condition: condition:
pwd: /home/commander pwd: /home/commander
command: command:
- cat file1 - cat file1
- id: read-file2
task: 嘗試查看 `file2` 的內容
requirements:
- ls-l
condition:
pwd: /home/commander
command:
- cat file2
- id: read-file3
task: 嘗試查看 `file3` 的內容
requirements:
- ls-l
condition:
pwd: /home/commander
command:
- cat file3
- id: read-files
requirements:
- read-file1
- read-file2
- read-file3
responses: responses:
- type: narrative - type: narrative
content: content:
- 你看到 `file1` 的內容了! - 你已經試著查看 `file1` 、 `file2` 、 `file3` 的內容了!
- 現在試著執行看看 `file1` 吧! - 現在請用 `echo [檔案名稱]` 回答現在有哪的檔案的讀取權限。
# {unfinished}
- id: cat-continue - id: cat-continue
task: 使用 `echo continue` 來繼續 task: 使用 `echo continue` 來繼續
File renamed without changes.
File renamed without changes.
File renamed without changes.