Follow the below steps to come out from telnet in Linux/Unix.
Press control "]" 

 Then Type quit. it will come out from telnet window