How to test a TCP (or UDP) remote port without telnet or netcat (in a one-liner):
(google’s IP and TCP to 443)
timeout 1 bash -c '</dev/tcp/216.58.207.46/443 && echo Port is open || echo Port is closed' || echo Connection timeout
#shellmagic
-
-
$ uname -a Linux backpack 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux $ timeout 1 bash -c '</dev/tcp/216.58.207.46/443 && echo Port is open || echo Port is closed' || echo Connection timeout Port is open
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Yup, we're quite fond of implementing least surprise in our kit ;-) heheheh -- Will double check my Debian 9 tonight.
-
Was re-enabled in bash 4.0-5 in Sep 2009 after being disbaled for 9 years ;).
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.