相對於圖形化介面 (GUI=Graphical User Interface),Command Line是使用純文字與電腦溝通的方式。Mac使用者除了可以使用內建的軟體「terminal」處理這些指令文字,也可另外安裝「iterm2」與其他樣式版型外掛,使得操作指令的過程更舒適好閱讀。
顯示目前目錄所在路徑
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
列出目錄內所有內容
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
進入下一層目錄。例如:
cd Keynote
=進入名為Keynote之資料夾。Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
留意以下..
和 ~ 的前面有空格
cd .. = 返回上一層目錄
cd ../.. = 返回上兩層目錄
cd ~ = 直接回到根目錄
輸入cd
空格時,按鍵盤tap
會自動列出底下的資料夾列表(就像是輸入ls
,這個小訣竅等於是同時做「查詢」與「選擇」)
tap
會幫你自動補完資料夾名稱tab
或是方向鍵選取想要的資料夾tab
一次再繼續選下一層資料夾
Learn More →
\
將空格隔開,才能正確選擇對象。例如:資料夾名稱為「empty space」,可以看到中間有個空格,若想使用cd指令進入此資料夾,必須輸入cd emptey\ space
這項指令才能被正確執行
Learn More →
Learn More →
新增資料夾。例如新增一個名叫 cute 的資料夾:
mkdir cute
和圖形化介面相對照,可看到確實新增了新資料夾。
Learn More →
Learn More →
新增檔案。例如:新增一個名為 hello 的 txt檔:
touch hello.txt
於目前所在目錄中新增一個hello.txt
檔案
Learn More →
快速查看檔案內容
cat hello.txt
Learn More →
筆記本內文如下,可以看到 cat 把內文顯示出來了。
Learn More →
刪除檔案。例如:刪除名為 another 的 txt檔:
rm another.txt
Learn More →
刪除空目錄(空資料夾)。例如:刪除一個名為
empty space
的資料夾
rmdir empty\ space
Learn More →
複製資料夾或是檔案。
cp -fi hello.txt beautiful
將 hello.txt 複製到 beautiful 資料夾中。
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
cd -r cute ../
將名為 cute 資料夾複製到上一階層目錄中。
Image Not Showing Possible ReasonsLearn More →
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
用來移動資料夾或檔案。例如:將 text.txt 移動至上一層目錄中。
mv text.txt ../
Learn More →
Learn More →
Learn More →
Git是什麼 Git是一個是一個免費的、開源的工具,是一個版本控制系統軟體,可以從官網直接下載到本機電腦,它可以幫助軟體開發過程更順暢。Git好比一個管家,我們可以透過Git對程式碼進行分散式的版本修改控制(Git is a free and open source distributed version control system)。 為什麼要使用Git 備份管理好輕鬆 一個功能/軟體/網站/App......的開發過程,需要管理不同階段的程式碼修改,沒有Git以前,我們得拷貝數個檔案、用日期命名、新增拷貝一堆資料夾在自己的電腦上備份,再一一上傳到遠端料庫更新,有時還要擔心上傳的檔案會不小心與協作夥伴彼此覆蓋。 管家幫你監視倉庫 Git就像是一個管家,我們把所有專案開發的程式碼放在一個倉庫中,在這個倉庫內所發生的所有繁雜修改過程,都可以託管給這個管家,命令它隨時檢視、回報異動等等,再由Git幫我們跑腿,把這個倉庫內產生的所有紀錄,傳送到另一個遠端的倉庫。
Apr 11, 20221.下載並安裝 iterm2 到 iterm2 官方網站下載安裝檔。 第一步就出師不利......!目前使用的MacbookPro版本太舊,是10.12的,iterm2官方表示至少要10.14才支援,但是這台電腦是借來的,請教別人後獲得允許才敢替電腦更新。然而最新版的Big Sur不知為何始終安裝不了,網路爬文也只看到類似無法安裝的災情回報但沒找到明確解方,後來意外找到10.15 Catalina的安裝檔總算更新完畢,多費了一天總算完成第一步安裝iterm2。 2.安裝Homebrew 根據Homebrew官方網站說明,複製指令貼到iterm2裡安裝。 這時發現指令最前面的$符號原來不需要複製,而最後面的上引號「"」是指令的一部分,一定要複製。
Apr 11, 2022tags: Github git clone git pull Pull Request codeshiba 學習重點 git clone 完整複製他人專案到自己電腦 建立與切換 branch 設定 upstream 發送 Pull Request 請求合併 git pull 更新既有專案狀態至最新 clone和pull差別在哪
May 10, 2021Markdown是一種輕量級標記式語言,透過輸入直覺的純文字符號標籤,就能建立帶有各種視覺變化與互動功能的的純文字檔,方便製作出好閱讀又附功能性的筆記。 目錄 [ToC] 1.標題字大小指定 Markdown 語法使用井字號 # 建立標題文字,井字號數量從1個~6個可以產出對應HTML標籤中<h1>~<h6>大小的字。H1和H2標題底下會自動伴隨細水平線。 # H1 ## H2
May 8, 2021or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up