What does Ctrl+C do in Ubuntu Terminal?

5

2

Does anyone know what Ctrl+C and Ctrl-V do in Ubuntu Terminal? Since they don't copy/paste, is there any particular functionality to these buttons?

When I press those shortcut, it writes ^C and ^V.

I'm worried because I was working on a little PHP program, and I'm editing from terminal. I'm a control freak, and I would hate if those buttons did something I'm not aware of.

user98645

Posted 2011-09-21T16:42:01.013

Reputation:

This question belongs to http://askubuntu.com/

– Danilo Piazzalunga – 2011-09-21T16:45:51.697

More appropriate site for this question: http://askubuntu.com/

– Cymen – 2011-09-21T16:46:13.127

Answers

7

  • Ctrl+C is abort in UNIX:

    In POSIX systems, the sequence causes the active program to receive a SIGINT signal. If the program does not specify how to handle this condition, it is terminated. Typically a program which does handle a SIGINT will still terminate itself, or at least terminate the task running inside it.

  • Ctrl+V in UNIX:

    Unix interactive terminals use Control-V to mean "the next character should be treated literally" (the mnemonic here is "v is for verbatim"). This allows a user to insert a literal Control-C or Control-H or similar control characters that would otherwise be handled by the terminal.

This is in the shell and it's just defaults. When running a program, it is dependent on the program what these do!

Cymen

Posted 2011-09-21T16:42:01.013

Reputation: 186

The signal is SIGINT. – Rob – 2011-09-21T16:53:56.313

Pedantry: Since there is a SIGABRT that signals an "abort", I would change "is abort in UNIX" to "is 'interrupt' in UNIX". – Chris Page – 2011-09-22T04:33:05.473

2

Ctrl+C sends a terminating signal to the current process running.

To copy or paste in the terminal, press Ctrl+Shift+C or Ctrl+Shift+V.

nuclearpenguin

Posted 2011-09-21T16:42:01.013

Reputation: 161

0

I don't know about Ctrl+V, but I know that Ctrl+C stops whatever program you are running.

If you want to copy or paste using keyboard shortcuts, you can use Ctrl+Shift+C or Ctrl+Shift+V respectively.

Yotam

Posted 2011-09-21T16:42:01.013

Reputation: 559

Ctrl+C don't stop "what ever program you are running" it's false, it just send a SIGINT signal to the process on the foreground. If the process is not defined to stop on SIGINT, the process stay alive. – FAjir – 2019-08-27T08:45:00.583