Window CommandLine


1. PowerShell

#  查看powershell 版本
get-host
$host.version
#  新建目录
#当前目录新建文件
new-item FILENAME.xxx -type file
#当前目录新建文件夹
new-item DIRECTORYNAME -type directory
#在指定目录新建
new-item TARGETDIR FILENAME.xxx -type file
#  重命名
#把 C:/Scripts/Test.txt 重命名为 C:/Scripts/New_Name.txt:
Rename-Item c:/scripts/Test.txt new_name.txt
#  移动文件
Move-Item c:\scripts\test.zip c:\testX
#  删除目录/文件
remove-item file
#显示文本内容
get-content 1.txt
#罗列系统驱动器
get-psdriver
#下载文件
powershell -Command "(New-Object Net.WebClient).DownloadFile('https://ts', './src/ts')"
#支持linux 文件  ls,dir,pwd,cat, more
# 中文输出乱码
打开控制面板 -> Change date,time,or number -> 打开 “Region” 对话框
选择 Administrative 选项卡,点击 change system locale
选择

2. Cmd

where cmd #类似Linux中where 命令
find /r 目录名 %变量名 in (匹配模式1,匹配模式2) do 命令
for /r 目录名 %i in (匹配模式1,匹配模式2) do @echo %i
for /r TestDir %i in (*) do @echo %i  #将TestDir目录及所有子目录中所有的文件列举出来
for /r TestDir %i in (*.txt) do @echo %i  #在TestDir目录所有子目录中找出所有的txt文件
for /r TestDir %i in (.txt,.jpg) do @echo %i #找出所有的txt及jpg文件
for /r TestDir %i in (test) do @echo %i  #找出所有文件名中包含test的文件
Tree   #罗列文件目录

Author: liudongdong1
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source liudongdong1 !
 Previous
PPT Useful Plugin PPT Useful Plugin
1、PPT美化大师“让制作专业精美PPT变得简单”“让不会做PPT的人,也能做好PPT”作为一款由wps的开发公司金山软件开发的PPT插件,自然来头不小,也不负大师之名。 1.1、内容规划 生成模板在美化大师工具栏选择新建一个PPT,选择美
2020-05-11
Next 
Typoro Command Typoro Command
​ Typora 是一个 Markdown 文本编辑器,它支持且仅支持 Markdown 语法的文本编辑。在 Typora 官网 上他们将 Typora 描述为 「A truly minimal markdown editor.
2020-04-26
  TOC