創(chuàng)建文件夾
md aa
mkdir aa
md c:\test\myfolder
進(jìn)出文件夾/切換盤
cd aa
cd ..
c:
e:\a>cd d:\nginx------>e:\a>d:------>>d:\nginx>
刪除文件夾
rd aa
rmdir aa
rd /s /q [盤符:\][路徑\]新目錄名
rd /s /q c:\test\myfolder
------>rd只有刪除空文件夾不會停下來
------>加上/s可以直接刪除
------>/s刪除過程中會提示確定刪除巷嚣,加上/q不做提示刪除(/q=quiet 安靜模式)
創(chuàng)建空文件
type nul>"*"
type nul>myfile.txt
type nul>.test<------不帶文件名的.test文件
E:\v\mt\components>type nul>.\public\footer\index.vue
創(chuàng)建帶內(nèi)容文件
echo [fileContent]>"."?
echo myname>aaaa.txt
echo 這是創(chuàng)建的txt文件的文本內(nèi)容>aaaaaaa.txt
刪除文件
del "*"<------控制臺直接刪除的文件绣夺,不會進(jìn)入回收站
del aaa.txt
del myfile.txt
重命名文件或文件夾
重命名文件不要忘記帶后綴
rename a.txt qqq
rename qqq?c.txt
重命名文件夾
rename b qq
移動文件或文件夾
移動 a 文件夾下面的 b.txt 到 b 文件夾下面
move .\a\b.txt .\b
移動 a 文件夾到 b 文件夾下面
move .\a\ .\b
.\a\b.txt 可以寫成 a\b.txt
打開文件夾
explorer .
e:\mt>explorer .\components
使用工具打開文件或文件夾
使用? Visual Studio Code 當(dāng)前文件夾:code .
使用? Visual Studio Code 當(dāng)前文件夾下的某個文件:
code .\a.text
code ..\a.js
code .\src\a.js
code? a.html
C:\Users\Me>code e:\v\mt\
Code不區(qū)分大小寫,Code.exe被配置到了path里面了,
所以可以在CMD控制臺里面找到 Code.exe 應(yīng)用程序测僵;
同理其他工具也可以這樣配置操作。
注意: code .\src\a.js 使用反斜杠按tab有提示鹤啡, code ./src/a.js 這樣寫沒提示 也能打開文件