Monday, November 10, 2014

Command of the day: ^]

You may have seen it hundreds of times but few know what it means.
Escape character is '^]'.
It is actually quite obvious is you know that the caret ^ is a shorthand notation for 'Control' (or <Ctrl> as would be more familiar to windows users).
So what is it? It is not actually a command but a keystroke for the telnet command. It opens a command prompt from where you can enter a variety of commands.
Possibly the most exciting thing you can do is then press ^Z ( <Ctrl>+z ) and suspend your telnet session, returning you to your local shell. You can then resume later by using your shell job control (ie. 'fg').
Some other useful commands are
  • quit (or press ^C)
  • send brk (which if supported will send a break)
  • speed 115200 (which if supported will switch the serial line speed)
  • close (disconnect the session)
  • open (establish a new session)
  • help (list the available commands)
And there are many more documented in the telnet man page.

In this day and age, any server shell access should be via a secure protocol like ssh. telnet remains however as a handy tool for testing TCP servers and accessing specialised equipment like serial concentrators.

It is also worth noting that telnet is actually a protocol and not just a raw TCP stream. There is a lot of negotiation which is done to ensure that your terminal works correctly. Often this only becomes obvious when your terminal does not work correctly.

No comments:

Post a Comment