创建文件夹
md aa
mkdir aa
md c:\test\myfolder
进出文件夹/切换盘
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 安静模式)
创建空文件
type nul>"*"
type nul>myfile.txt
type nul>.test<------不带文件名的.test文件
E:\v\mt\components>type nul>.\public\footer\index.vue
创建带内容文件
echo [fileContent]>"."
echo myname>aaaa.txt
echo 这是创建的txt文件的文本内容>aaaaaaa.txt
删除文件
del "*"<------控制台直接删除的文件,不会进入回收站
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 当前文件夹:code .
使用 Visual Studio Code 当前文件夹下的某个文件:
code .\a.text
code ..\a.js
code .\src\a.js
code a.html
C:\Users\Me>code e:\v\mt\
Code不区分大小写,Code.exe被配置到了path里面了,
所以可以在CMD控制台里面找到 Code.exe 应用程序;
同理其他工具也可以这样配置操作。
注意: code .\src\a.js 使用反斜杠按tab有提示, code ./src/a.js 这样写没提示 也能打开文件
网友评论