
win/linux实用命令
文件校验
win
certutil -hashfile (filename) [hashfun]
hashfun为hash算法,可以选择MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512
linux
md5sum (filename)
linux查看文件夹大小
du -sh
du -sh *
du -a #显示所有
du -h #换算大小为G、M
du -d 1 #统计文件夹的深度为1
run文件
a.run --target tempDir #解压到tempDir文件夹
端口转发
ssh -g -L 0.0.0.0:9988:169.254.76.122:22 ubuntu@169.254.76.122
可以在powerhsell中使用
或者直接使用以下脚本:
# 提示用户输入 IP 地址或域名
input = Read-Host "请输入 IP 地址或域名"
# 构建 SSH 命令sshCommand = "ssh -g -L 0.0.0.0:9988:{input}:22 ubuntu@input"
Write-Host sshCommand
# 执行 SSH 命令
Start-Process powershell -ArgumentList "-NoExit", "-Command",sshCommand
查看依赖
先打开VS开发人员命令行,这个程序在VS安装目录下
dumpbin.exe /dependents filename.exe
查看日志
win
Get-Content a.log -Wait #powershell 执行 -Wait可以实时刷新
Get-Content a.log -Tail 10 #获取最后10行
Get-Content a.log | -Select-String "error" #过滤error
linux
tail -f -n 100 a.log #-f实时刷新,-n显示最后 100 行
