命令备忘
文章目录
- 通过端口查进程
netstat -ano | findstr 8000
(Get-NetTCPConnection | Where-Object {$_.LocalPort -eq 8000 -and $_.State -eq 'Listen'}).OwningProcess | Sort-Object | Get-Unique
- 通过进程查端口
(Get-NetTCPConnection | Where-Object {$_.OwningProcess -eq 19104 -and $_.State -eq 'Listen'}).LocalPort | Sort-Object | Get-Unique
- 查找进程的详细信息
wmic process where "processid=10856" list full
wmic process where "processid=10856" get ExecutablePath
- 硬链接查看和创建
fsutil hardlink list package.json
fsutil hardlink create <新文件> <已存在的文件>
- 端口转发
- 查询转发规则
netsh interface portproxy show all
- 添加转发规则
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=3306 connectaddress=localhost connectport=3306
- 删除转发规则
netsh interface portproxy delete v4tov4 listenaddress=0.0.0.0 listenport=3306
- 重置转发规则
netsh interface portproxy reset
- 查询转发规则
- dotnet发布命令
dotnet publish -c Release -r win-x64 --self-contained=true /p:UseAppHost=true /p:PublishSingleFile=true /p:EnableCompressionInSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:IncludeAllContentForSelfExtract=true /p:PublishTrimmed=true
- ef逆向命令
dotnet ef dbcontext scaffold "Data Source=C:\Users\sunburst\AppData\Local\blogging.db" Microsoft.EntityFrameworkCore.Sqlite
dotnet ef dbcontext scaffold "Name=ConnectionStrings:DefaultConnection" Microsoft.EntityFrameworkCore.Sqlite
dotnet ef dbcontext scaffold "Server=192.168.1.5;Port=3306;Database=wine_cet4_word;User=root;Password=mUzaCLQQuk0GY11BF7UCLEW;Charset=utf8;Sslmode=none" Pomelo.EntityFrameworkCore.MySql
- scp传输文件
scp C:\Windows\Fonts\simkai.ttf vmware:/var/www/fileserver/
文章作者 Sunburst
上次更新 2024-04-09