centos 上我们可以直接用telnet进行连接,测试是否可以

如果没有telnet命令,可以使用yum 先安装telnet

yum install telnet

[root@VM_0_14_centos /]# telnet localhost 80


Connected to localhost.

Escape character is '^]'.


macos 下面使用一下命令

van@van ~$ nc -vz -w 2 94.19.**.218 80

found 0 associations

found 1 connections:

     1: flags=82<CONNECTED,PREFERRED>

outif en0

src port 59344

dst port 80

rank info not available

TCP aux info available


Connection to 94.19.**.218 port 80 [tcp/http] succeeded!


van@van ~$ nc -help

usage: nc [-46AacCDdEFhklMnOortUuvz] [-K tc] [-b boundif] [-i interval] [-p source_port] [--apple-delegate-pid pid] [--apple-delegate-uuid uuid]

[-s source_ip_address] [-w timeout] [-X proxy_version]

[-x proxy_address[:port]] [hostname] [port[s]]

Command Summary:

-4Use IPv4

-6Use IPv6

-ASet SO_RECV_ANYIF on socket


-b ifboundBind socket to interface

-cSend CRLF as line-ending

-CDon't use cellular connection

-DEnable the debug socket option

-dDetach from stdin

-EDon't use expensive interfaces

-FDo not use flow advisory (flow adv enabled by default)

-G conntimoConnection timeout in seconds

-hThis help text

-H keepidleInitial idle timeout in seconds

-I keepintvlInterval for repeating idle timeouts in seconds

-i secsDelay interval for lines sent, ports scanned

-J keepcntNumber of times to repeat idle timeout

-kKeep inbound sockets open for multiple connects

-K tclassSpecify traffic class

-lListen mode, for inbound connects

-L num_probes Number of probes to send before generating a read timeout event

-mSet SO_INTCOPROC_ALLOW on socket

-nSuppress name/port resolutions

-MUse MULTIPATH domain socket

-N num_probes Number of probes to send before generating a write timeout event

-OUse old-style connect instead of connectx

-p portSpecify local port for remote connects (cannot use with -l)

-rRandomize remote ports

-s addrLocal source address

-tAnswer TELNET negotiation

-UUse UNIX domain socket

-uUDP mode


-w secsTimeout for connects and final net reads

-X protoProxy protocol: "4", "5" (SOCKS) or "connect"

-x addr[:port]Specify proxy address and port

-zZero-I/O mode [used for scanning]

-oIssue socket options after connect/bind

--apple-delegate-pid pidSet socket as delegate using pid

Port numbers can be individual or ranges: lo-hi [inclusive]


2,666 对 “linux / mac os ping 指定端口号”的想法;

  1. Hello there I am so thrilled I found your blog page, I really found you by accident, while I was
    looking on Google for something else, Anyhow I am here now and would just like to say thanks for a tremendous
    post and a all round exciting blog (I also love the theme/design),
    I don’t have time to read it all at the minute but I have book-marked it and
    also added in your RSS feeds, so when I have time I will be back
    to read a lot more, Please do keep up the fantastic

  2. You are so interesting! I don’t think I have read through anything like this
    before. So good to find someone with some unique thoughts on this issue.
    Really.. many thanks for starting this up. This site
    is one thing that’s needed on the internet, someone with some originality!

  3. Greetings from Colorado! I’m bored to death at work so I decided to browse
    your blog on my iphone during lunch break. I really like the
    knowledge you present here and can’t wait to take a
    look when I get home. I’m surprised at how quick your blog loaded on my
    mobile .. I’m not even using WIFI, just 3G .. Anyhow, superb site!

  4. With havin so much content do you ever run into any issues of plagorism or
    copyright infringement? My site has a lot of completely unique content I’ve either authored myself or outsourced but it appears a lot of it is popping it up all over the web without my permission. Do you know
    any techniques to help protect against content from being stolen? I’d truly appreciate it. http://droga5.net/

  5. It’s the best time to make some plans for the future and it is time to be happy.
    I have read this post and if I could I desire to suggest you
    few interesting things or advice. Maybe you could write next articles referring to this article.

    I want to read even more things about it!

  6. Fantastic goods from you, man. I have understand your stuff previous to and you are just too magnificent.

    I really like what you’ve acquired here, certainly like what you are saying and
    the way in which you say it. You make it entertaining and you still take care of to keep it wise.

    I can’t wait to read far more from you. This is really a wonderful site.