How to exit from: vi(m), telnet, bash, …

Exit VI(M)

  1. Press ESC to enter normal mode,
  2. Optional: Type :w (colon + w) to save changes,
  3. Type :q (colon + q) to exit vi(m).
  4. If you don’t want to save changes, add an exclamation mark – :q!

More about vi(m) modes you can find e.g. here: https://en.wikibooks.org/wiki/Learning_the_vi_Editor/Vim/Modes

You are not alone: https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/

Exit Telnet

Telnet is giving you a hint:


Escape character is '^]'

In this case ^ character means control (command in macOs). So combination what you’re looking for is ctrl+].

Then, after entering command mode – type quit (and confirm with enter key).

Connection closed.

Exit sh/bash

Simply: type exit.

Exit running script/command

Hit ctrl+c to break/exit from it.

Exit any process

In bash type kill <process ID>

You can also use (h)top app to find process and terminate it.