Windows下的grep命令:findstr
C:\>dir | findstr "Program Files" :: 查找当前文件夹下包含指定字符串的文件
2022/10/18 11:14 <DIR> Program Files
2022/10/11 15:50 <DIR> Program Files (x86)
C:\>netstat -nao | findstr "3306" :: 查看指定端口的 PID(最后一列)
TCP 0.0.0.0:3306 0.0.0.0:0 LISTENING 6248
TCP 0.0.0.0:33060 0.0.0.0:0 LISTENING 6248
TCP [::]:3306 [::]:0 LISTENING 6248
TCP [::]:33060 [::]:0 LISTENING 6248
C:\>tasklist | findstr "6248" :: 查看指定 PID 的进程
mysqld.exe 6248 Services 0 13,468 K
参考:Windows 下的 grep 命令--findstr、How to Use the DIR Command in Windows、Windows 下如何查看某个端口被谁占用