Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.user > #171784
| From | Charlie Kravetz <cjk@teamcharliesangels.com> |
|---|---|
| Newsgroups | linux.debian.user |
| Subject | Re: How to forcibly abort a command in a terminal window? |
| Date | 2016-09-05 18:30 +0200 |
| Message-ID | <se4Wu-68Q-17@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <se1YC-4eB-41@gated-at.bofh.it> <se2i3-4lH-13@gated-at.bofh.it> <se2L0-4LX-53@gated-at.bofh.it> <se3H4-5qz-41@gated-at.bofh.it> <se3QJ-5u6-1@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, 5 Sep 2016 17:19:38 +0200 Nicolas George <george@nsup.org> wrote: >Le decadi 20 fructidor, an CCXXIV, Charlie Kravetz a écrit : >> I open a second terminal, then use ps -A to find the command. I can >> kill it with "sudo kill ????" which kills the job number. It is not >> always instant, but faster than ctrl-c for some things, including rsync >> and cp . > >Not true. > >The only difference between your method and kill is that kill will send >SIGTERM (number 15) by default while Ctrl-C sends SIGINT (number 3) by >default. But both have the same default action of interrupting the process. > >cp does not handle signals explicitly, leaving them to their default >behaviour. rsync catches signals, but with the same handler for SIGINT and >SIGTERM. Therefore, the effect of Ctrl-C and kill on both is exactly the >same. The difference you observe is certainly only psychological. > >Note that the same does not apply to "kill -9": SIGKILL, number 9, can not >be caught by processes. Yet, since cp does not catch signals, Ctrl-C, kill >or kill -9 will have the same effect. On rsync, "kill -9" will prevent it >from cleaning up temp files, which can be a life saver if you forgot the -P >option and already copied a big chunk of data over a slow link. > >Also note that other applications may behave differently. I have noticed >that Python applications using Qt ignore SIGINT for no apparent reason >except annoy developers. Knowing ^\, i.e. SIGQUIT, is useful in that kind of >cases, even though this is not the purpose of SIGQUIT. > >Regards, > Psychological or not, it certainly works for me. By killing the job number, it forces it to stop on my computer. -- Charlie Kravetz Linux Registered User Number 425914 [http://linuxcounter.net/user/425914.html] Never let anyone steal your DREAM. [http://keepingdreams.com]
Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How to forcibly abort a command in a terminal window? Richard Owlett <rowlett@cloud85.net> - 2016-09-05 13:50 +0200
Re: How to forcibly abort a command in a terminal window? Henrique de Moraes Holschuh <hmh@debian.org> - 2016-09-05 14:30 +0200
Re: How to forcibly abort a command in a terminal window? Richard Owlett <rowlett@cloud85.net> - 2016-09-05 15:20 +0200
Re: How to forcibly abort a command in a terminal window? Jonathan Dowland <jmtd@debian.org> - 2016-09-05 15:40 +0200
Re: How to forcibly abort a command in a terminal window? Richard Owlett <rowlett@cloud85.net> - 2016-09-05 16:10 +0200
Re: How to forcibly abort a command in a terminal window? Charlie Kravetz <cjk@teamcharliesangels.com> - 2016-09-05 17:10 +0200
Re: How to forcibly abort a command in a terminal window? Nicolas George <george@nsup.org> - 2016-09-05 17:20 +0200
Re: How to forcibly abort a command in a terminal window? Dutch Ingraham <stoa@gmx.us> - 2016-09-05 18:20 +0200
Re: How to forcibly abort a command in a terminal window? Nicolas George <george@nsup.org> - 2016-09-05 18:40 +0200
Re: How to forcibly abort a command in a terminal window? Charlie Kravetz <cjk@teamcharliesangels.com> - 2016-09-05 18:30 +0200
Re: How to forcibly abort a command in a terminal window? Vincent Lefevre <vincent@vinc17.net> - 2016-09-05 21:40 +0200
csiph-web