5 ms·
> nc -z -v -w 5 raspberrypi 22 Vs > telnet raspberrypi 22 No, I will keep using telnet over netcat. I’m not remembering and looking up those switches over an
by prepend 4y ago
> nc -z -v -w 5 raspberrypi 22
Vs
> telnet raspberrypi 22
No, I will keep using telnet over netcat. I’m not remembering and looking up those switches over and over.
If I’m automating port checks, I’m probably using neither. But if I want to check if something is listening then I can remember the telnet command and will use that.
- everforward 4y agoThat was my first thought. Both the bash and expect scripts seem more complicated than the equivalent Python. expect requires me to know a fairly niche DSL, and the bash version requires me to remember a bunch of arcane info like the ability to make TCP connections by echoing into /dev. I would push back on an MR with either of the first two. The bash+nc one I could live with, though.
- phone8675309 4y agoYou could just make a shell alias or wrapper script that would simplify the whole thing
- prepend 4y agoYes, certainly. But, for me, the reason I’m telnetting to ports is because I just want to check as a one off. If I check so frequently that I need an alias, I’ll use something else. So if I want a quick hack, I just need a quick hack. Not sure why nc is that much better for me to tell if something is listening on a port.
- arp242 4y agoYou can just use "nc raspberrypi 22" as well; don't really need those flags.