sysconfig/portscan.sh
2023-06-28 01:45:19 +00:00

15 lines
189 B
Bash
Executable File

if [ "$1" ]
then
PORT=$1
else
echo "=== 需要查看的端口号:"
read -p ">>> " PORT
fi
if [ "$(uname)" = "Darwin" ]
then
lsof -i tcp:$PORT
else
netstat -tunlp | grep $PORT
fi