I\'m running telnet command on a host for a given port (which is open), it returns 0 (success).
telnet
For trying telnet manually, I type the following comman
╭─ ~ ╰» echo "^]close^M" | telnet localhost 22; echo $? Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. telnet> close Connection closed. 0
To enter the ^] and ^M characters, press ctrl+v ctrt+] and ctrl+v ctrl+m respectively.
^]
^M
ctrl+v
ctrt+]
ctrl+m