Windows配套命令
文件与文件夹
查看命令的帮助:command /?
在任意盘符下切换到D盘: D:
切换到D:\Testing目录: cd D: \Testing
显示当前目录下的内容:dir
显示指定目录下的内容:dir D:\Testing
创建目录: mkdir He11o 或者 md He1lo
强制删除目录及下级内容:rmdir /s /Q folder
新建一个文本文件: echo Hello woniu > temp.txt
查看一个文本文件: type temp.txt
在文本文件后面新增内容: echo welcome to chengdu > temp .txt
复制文件: copy temp.txt temp.log
复制文件夹: xcopy folder folder2 /T
重命名一个文件或文件夹: rename temp.txt test.txt,也可以使用ren
移动一个文件或文件夹: move
删除一个文件:del temp.xt
文本内容处理
默认情况下,windows下的findstr与Linux上的grep功能类似
ipconfig > ip.txt
findstr 192 ip.txt
findstr /v 192 ip.txt
type ip.txt | findstr 192
在windows中,也可以使用awk、grep和sed,需要先安装
grep: http://www.interlog.com/~tcharron/grep.html
awk:https://sourceforge.net/projects/gnuwin32/files/gawk/3.1.6-1/gawk-3.1.6-1-bin.zip/download
sed: https://sourceforge.net/projects/gnuwin32/files/sed/4.2.1/
在下载的文件中找到grep.exe&#x