windows常用命令

windows常用命令

切换目录:cd 目录路径

切换盘符:d:

查看端口号的占用情况:netstat -aon|findstr "8080" 或者 netstat -ano

查看占用端口对应的进程或程序:从上面一条命令获取pid,tasklist|findstr "pid"

查看进程的运行路径:wmic process where name="svchost.exe" get processid,executablepath,name

结束进程:taskkill /f /t /im svchost.exe

查看当前用户:whoami

开启本地抓包服务:net start npf / 关闭 net stop npf

查看nginx服务信息:tasklist /fi "imagename eq nginx.exe"

结束nginx服务进程:taskkill /f /pid 2728

根据PID查看是哪个进程占用了端口:tasklist|findstr "12712"

根据pid杀死进程:taskkill /pid 12712 -f

原文地址:https://www.cnblogs.com/myfaith-feng/p/13906105.html