3

After typing a bad command in terminal like below, the prompt does not exit. Tried Ctrl+c, Ctrl+z, Ctrl+q. Nothing helps to exit > prompt.

[root@172.17.148.40|eco9]# vi /etc/lru.cfg'
> 
> vi /etc/lru.cfg
> 
> 
> 
TBF
  • 82
  • 1
  • 1
  • 8

4 Answers4

4

Bash waits for you to terminate the quoted string with another single quote character. So you can either do 'Enter and exit vi in a normal way, or use Ctrl + C to cancel the command.

">" is the default value of the $PS2 variable, a.k.a secondary prompt string.

Eugene Yarmash
  • 142,882
  • 41
  • 325
  • 378
3

Ctrl+ \ will send a SIGQUIT signal. Try that if Ctrl+C (sends a SIGINT signal) does not work.

Shalini Maiti
  • 346
  • 2
  • 5
1

How about Ctrl + D, or just ' and Enter (and then :q to exit vi).

wrwrwr
  • 1,008
  • 2
  • 11
  • 19
0

Ctrl + C works for me. Anyway, try adding the closing single quote and Enter.

choroba
  • 231,213
  • 25
  • 204
  • 289