The function of this command is to input the port to find the corresponding pid, but I don't understand what the ^ symbol is used for, can someone explain it?
for /f "tokens=5" %a in ('netstat -aon ^| find ":3306" ^| find "LISTENING"') do echo %a
CodePudding user response:
From https://ss64.com/nt/syntax-redirection.html
Escape Character
^ Escape character.
Adding the escape character before a command symbol allows it to be treated as ordinary text. These characters which normally have a special meaning can be escaped and then treated like regular characters : & \ < > ^ |
e.g. Echo THIS ^& THAT
Echo Heading1 ^| heading2 ^| heading3
Echo The Escape character looks like this ^^