Efficiently test if a port is open on Linux?

后端 未结 14 1043
面向向阳花
面向向阳花 2020-12-02 04:02

From a bash script how can I quickly find out whether a port 445 is open/listening on a server.

I have tried a couple of options, but I want something q

14条回答
  •  渐次进展
    2020-12-02 04:22

    You can use netcat command as well

    [location of netcat]/netcat -zv [ip] [port]
    

    or

    nc -zv [ip] [port]
    

    -z – sets nc to simply scan for listening daemons, without actually sending any data to them.
    -v – enables verbose mode.

提交回复
热议问题