git bash 操作檔案及資料夾命令

2023-01-19 12:00:38 字數 620 閱讀 9216

1.cd : 切換到哪個目錄下, 如 cd e:\fff  切換 e 盤下面的fff 目錄。

當我們用cd 進入資料夾時,我們可以使用 萬用字元*, cd f*,  如果e盤下只有一個f開頭的資料夾,它就會進入到這個資料夾.

2.cd .. 回退到上一個目錄, 注意,cd 和兩個點點..之間有一個空格。

3.pwd : 顯示當前目錄路徑。

4.ls(ll): 都是列出當前目錄中的所有檔案,只不過ll(兩個ll)列出的內容更為詳細。

5.touch : 新建一個檔案 如 touch index.js 就會在當前目錄下新建一個index.js檔案。

6.rm:  刪除一個檔案, rm index.js 就會把index.js檔案刪除.

7.mkdir: 新建一個目錄,就是新建一個資料夾. 如mkdir src 新建src 資料夾.

8.rm -r : 刪除一個資料夾,  rm -r src 刪除src目錄, 好像不能用萬用字元。

9.mv 移動檔案, mv index.html src   index.html 是我們要移動的檔案, src 是目標資料夾,當然, 這樣寫,必須保證檔案和目標資料夾在同一目錄下.

10.reset 清屏,把git bash命令視窗中的所有內容清空。

檔案及資料夾操作

pathfileexists 函式可以用來檢視一個檔案或資料夾是否存在。用法 在標頭檔案中 include pragma comment lib,shlwapi.lib 如果沒有這行,會出現link錯誤 if pathfileexists strdbpath fof noconfirmmkdir 該...

shfile 檔案及資料夾操作

shfileoperation fof noconfirmation不顯示使用者確認 shfileoperation 函式功能描述 檔案操作,與 shell 的動作相同.函式原型 include winshellapi int winapi shfileoperation lpshfileopstr...

ftp檔案及資料夾操作

using system using system.collections.generic using system.linq using system.web using system.net using system.io using system.text namespace tecowebs...