码迷,mamicode.com
首页 > Windows程序 > 详细

windows中的常用Dos命令

时间:2019-03-17 18:16:52      阅读:235      评论:0      收藏:0      [点我收藏+]

标签:hello   创建文件   目录   查看文件内容   注意   window   file   创建   mkdir   

# __切换盘符目录__
E/D:  # 从C盘切换到E盘或者D盘
# __切换到指定文件夹下__
cd folder_name(指定文件夹名--相对/绝对路径)
cd .. # 返回上一级目录
cd / # 返回当前盘符根目录
# __清空当前电脑屏幕__
cls

# __创建文件夹__
mkdir folder_name(文件夹名)

mkdir 文件夹名\子文件夹 # 注意分隔符是\,而不是/

# __创建任意后缀的空文件__
type nul> file.postfix(文件名.后缀)
# __创建有内容的文件__
echo ‘content‘(内容) > file.postfix(文件名.后缀)
# __查看文件内容__
type file.postfix(文件名.后缀)
# __查看目录及子文件__
dir 或 ls
# __删除空文件夹__
rd folder_name(空文件夹名)
# __删除文件及所有子文件__
rd /s/q folder_name(文件夹名)
# __删除文件__
del file.postfix(文件名.后缀)

# ============================

C:\Users\15583>D:

D:\>mkdir test\app

D:\>cd test

D:\test>mkdir app1\help

D:\test>ls
app app1

D:\test>type nul>test.txt

D:\test>ls
app app1 test.txt

D:\test>echo ‘hello,python‘>test1.txt

D:\test>ls
app app1 test.txt test1.txt

D:\test>type test1.txt
‘hello,python‘

D:\test>rd app

D:\test>ls
app1 test.txt test1.txt

D:\test>rd app1
目录不是空的。

D:\test>rd /s/q app1

D:\test>ls
test.txt test1.txt

D:\test>del test.txt

D:\test>ls
test1.txt

D:\test>cd ..

D:\>rd /s/q test

D:\>cls

windows中的常用Dos命令

标签:hello   创建文件   目录   查看文件内容   注意   window   file   创建   mkdir   

原文地址:https://www.cnblogs.com/jason-Gan/p/10548026.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!