--- title: "[社課共筆]20251002-Shell I be the commander?" description: tags: - 社課 - 共筆 --- :::success # Shell I be the commander? **時間:** 2025/10/02(星期四)18:30 ~ 21:00 **地點:** 挺生大樓 A3-200 教室 **簡報:** [連結](https://slides.com/speedcubin/shell/) **回饋表單:** [連結](https://forms.gle/5f8nM1etAiaL75Dy6)  ::: ## 檔案系統 絕對路徑:從根目錄開始寫 相對路徑:從目前的工作目錄開始寫 常用符號: - `.`當前目錄 - `..`上層目錄 相對路徑的例子: > 目前在`/home/student/` 要找`/etc/nginx/nginx.conf` 就打`../../etc/nginx/nginx.conf` 意思:回兩層到根目錄的 etc 資料夾再找 nginx 資料夾再找到 nginx.conf ### 常見的options - `-h`:顯示說明(help) - `-v`:顯示詳細訊息(verbose) - `-r`:遞迴操作目錄(recursive) - `-f`:強制執行(force) - `-a`:顯示全部(all) - `-t`:時間(time) - `-l`:長格式(long) ## 指令列表: `man`:==man==uals 使用:man <command> //查詢某個指令的操作手冊 `echo`:輸出文字在終端上 `clear`:清空終端 `sudo`:以最高權限執行 `pwd`:印出當前所在位置(==p==rint name of current/==w==orking ==d==irectory) `ls`:列出資料夾內容 `cd`:切換工作目錄(==c==hange ==d==irectory) `touch`:建立檔案/更新檔案時間(沒人用) `cat`:修改(建立)檔案內容 使用:`cat > <file>` > [!Note] > Ctrl + D 結束輸出 > [!Tip] 註: > 通常使用 echo "字串" > file `head`:輸出檔案前部分 使用: - `head <file>` // 預設輸出前10行 - `head -n <lines> <file>` // 指定前幾行 `tail`:輸出檔案後部分 - `tail <file>` // 預設輸出末10行 - `tail -n <lines> <file>` // 指定末幾行 `mkdir`(make directory):建立資料夾 `rmdir`(remove directory):刪除資料夾 `rm`(remove):刪除檔案 刪掉會永遠找不到 強制刪除 `rm -f <file>` (忽略讀寫保護) ***非常危險 後果自負*** `mv`(move):移動檔案 `cp`(copy):複製檔案 <!-- 哇~感謝阿文用心的共筆 --> ## 寒期教育優先區營隊 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up