I am trying to install ruby virtual machine by running commands from terminal.While installing rails some error occurs and terminal got stuck up.What should be the action in the specified case.I tried ctrl+esc, esc, ../ etc like command prompt from windows.But it doesn't work.What is the proper way to end the process without closing the terminal?
Asked
Active
Viewed 8,958 times
2 Answers
3
-
1CTRL+C send a SIGINT to the process, which is can handle as it likes. It's very much a common and reasonable way to end a process. – Anders Olsson Dec 17 '15 at 10:15
-
@AndersOlsson You're absolutely right. I got confused myself in the middle of two answers suggesting to terminate a process with SIGKILL (one of which you can't see because it has been deleted), my bad. – kos Dec 17 '15 at 10:21
-
1Ctrl+Z also suspends it: https://askubuntu.com/a/510816/1088830 – applemonkey496 Jun 19 '20 at 18:11
-3
use ps or top to fınd out PID(proces ıd) and use kill -9 PID

Azat Aza
- 1
- 1
-
2
kill -9
is not the proper way to terminate a process, leaves everything in a messy state and resources allocated by the process around. You should first try at leastkill -15
. – kos Dec 17 '15 at 09:53 -
-
kill -9
sends a SIGKILL signal,kill -15
sends a SIGTERM signal. The first one is not ignorable / handable by the process, which is shut down by the kernel instantly (i.e. whatever the process was doing it's interrupted half-way, and in the best case the process will just leave temporary files around); the second one is ignorable / handable by the process, which has the chance to clean up allocated resources and to terminate gracefully (i.e. it does basically what's outlined in this answer) – kos Dec 17 '15 at 10:03