Common learning DOS operating instructions

Fundamental

  • Composition: dos terminal, dos operating system, file directory
    1. dos terminal transmits operation instructions to the operating system dos
    2. dos operating system commands and parse the file directory operations
    3. The file directory shows the results after disk operations

Common directory operation command

切换目录:cd /d 绝对路径(比如切换至d盘的data文件下: cd /d d:\data)
返回到上一级目录:cd ..
返回到根目录:cd \
查看当前目录的文件:dir
创建一个文件夹:md 文件名(比如在d盘建data文件夹:md data)须先切换至该文件目录下
删除一个文件夹:rd 文件名 (只能删除空的文件目录)
			  rd  /q/s 文件名 (不带询问地删除文件目录,无论是否为空)
			  rd /s 文件名 (带询问地删除文件目录,无论是否为空)

Common file operations

创建文件或以覆盖的方式写入文件:echo 要写入的内容 > 文件路径
复制文件:copy 要拷贝的文件的路径 即将拷贝到的文件路径
剪切文件:move 要剪切的文件的路径 即将要移动到的新目录
删除文件:del 文件路径

Absolute and relative paths

绝对路径:即从根目录到要选中的文件的全部路径指定
相对路径:即从当前所处的路径访问到要选中的文件的路径指定
注:虽然在dos指令操作中只试过部分的两种路径指定都可以执行相应的操作,但个人感觉dos操作指令中所用到的路径可以是这两种路径的任何一种
Released nine original articles · won praise 0 · Views 1007

Guess you like

Origin blog.csdn.net/qq_43156103/article/details/86619290