windows cmd常用命令集合(持续更新)

 

目录

 

windows useful cmd

rename one file

rename multiple files

add suffix

cat * | tar -zxv 

rm -rf xxx

cp one file to multiple path


 

 

 

windows useful cmd

rename one file

ren old.txt new.txt

rename multiple files

add suffix

If have multiple files(such as txt) in the path, rename all files and add suffix

# Have test.txt, old.txt
# add suffix _new_file
# got new file: test_new_file.txt and old_new_file.txt

for %a in (.\test\*.txt) do ren "%~a" "%~na_new_file%~xa"
for %a in (c:\test\*.txt) do ren "%~a" "%~na_new_file%~xa"

cat * | tar -zxv 

将多个分解的包合并解压

rm -rf xxx

rm: cannot remove ‘test\’: Device or resource busy

# Download handle from https://docs.microsoft.com/en-us/sysinternals/downloads/handle
$ unzip handle.zip
$ ls
handle.exe handle64.exe
$ handle64.exe  C:\temp\test
Nthandle v4.22 - Handle viewer
Copyright (C) 1997-2019 Mark Russinovich
Sysinternals - www.sysinternals.com

MobaXterm_Personal_12.3.exe pid: 31680  type: File           900: C:\temp\test

# kill the porcess by cmd or just close the software
$ TASKKILL /F /PID 31680

cp one file to multiple path

windows 使用cmder复制文件到多个目录中

# cmder on windows
# tree
λ ls
__init__.py  __pycache__ / parsing / reporting / run.py  utils/

# copy __init__py to parsing , reporting and utils
# Right way
λ echo parsing reporting utils | xargs - n 1 cp - v __init__.py
'__init__.py' -> 'parsing/__init__.py'
'__init__.py' -> 'reporting/__init__.py'
'__init__.py' -> 'utils/__init__.py'

# Wrong way
λ echo parsing\ reporting\ utils\ | xargs - n 1 cp - v __init__.py
'__init__.py' -> 'parsing reporting utils '$'\r'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值