mko
mko

Reputation: 22114

How to send EOF in line mode of telnet

I'm new to linux socket programming,after connected to the remote server

telnet x.x.x.x xxxx

How can I send a EOF character to the remote server through telnet?

these character escape doesn't seem to work

^D

^]D

`^]D`

and how to terminate this telnet connection

Upvotes: 2

Views: 9542

Answers (2)

Iain
Iain

Reputation: 994

In typical *ix telnet, you should be able to hold control and press ] (right square bracket) to get to the telnet prompt. From there, you can type 'quit' to exit telnet entirely.

The client should be telling you this when it first starts up. For instance, on my box:

~$ telnet localhost 2050
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

That last line is the pertinent one. Its using a caret ^ to represent 'hold control'. :)

It is possibly worthwhile to type 'help' to see what your other options are when you're at the telnet prompt.

Upvotes: 6

Ahatius
Ahatius

Reputation: 4875

telnet x.x.x.x xxxx <<EOF might be something.

Upvotes: 0

Related Questions