4 ms·
Expanding on this, ^\ (Ctrl+\) means sigkill, and I don't think many people know about this one.
by voidz 10y ago
Expanding on this, ^\ (Ctrl+\) means sigkill, and I don't think many people know about this one.
- giodamelio 10y agoWow, I can't believe I didn't know that. No more running killall in a new terminal!
- verbatim 10y ago^\ is actually sigquit, which is a bit different from sigkill, since programs can catch QUIT and perform some cleanup.
- semi-extrinsic 10y agoAlso ^| (as in, "control pipe") which is a synonym for ^\. At least for me, | is faster to hit than \ And since we're on this topic: if I write a for loop in bash that runs a slow command 1000 times (ImageMagick comes to mind), and I realise something has gone wrong, is there an easy way of breaking the outer loop?
- dragonwriter 10y ago> Also ^| (as in, "control pipe") which is a synonym for ^\. At least for me, | is faster to hit than \ How? Do you have a keyboard where | isn't Shift+\?
- Nullabillity 10y agoOn a Swedish keyboard, | is altgr+< (between shift and z), and \ is altgr++ (between 0 and ´).
- semi-extrinsic 10y agoI have a Norwegian keyboard, where as you can see, pipe has its own key to the left of "1" (above Tab): https://en.m.wikipedia.org/wiki/File:Keyboard_Layout_Norwegian.png https://en.m.wikipedia.org/wiki/File:Keyboard_Layout_Norwegi...
- Pete_D 10y agoIf you wrote the for loop interactively, you can suspend it with ^Z and kill its jobspec with 'kill %n' (for n usually = 1). If it's part of a script, your script probably wants to trap SIGINT.
- thomashabets2 10y agoNot a nice way, but the way that works best for me is: ^Z fg ^C the ^Z kills the loop, the fg and ^C cleans up the currently running one.
- caf 10y agoSIGQUIT also defaults to dumping core.
- vram22 10y agoIIRC, on Unix, Ctrl-\ sends the quit signal, which causes the process receiving it to do a core dump (before exiting), which can be used for post-mortem debugging, whereas Ctrl-C sends the kill signal, which makes the process terminate without any core dump. Those are the default actions for the signals. https://en.wikipedia.org/wiki/Control-%5C https://en.wikipedia.org/wiki/Control-%5C https://en.wikipedia.org/wiki/Core_dump https://en.wikipedia.org/wiki/Core_dump https://en.wikipedia.org/wiki/Control-C https://en.wikipedia.org/wiki/Control-C I remember doing: sdb a.out . core or something like that, in my C-on-Unix programming days earlier :) sdb was a debugger.
- vram22 10y agoSpeaking of terminating Unix processes, here's a post I wrote a while ago: UNIX one-liner to kill a hanging Firefox process: http://jugad2.blogspot.in/2008/09/unix-one-liner-to-kill-hanging-firefox.html http://jugad2.blogspot.in/2008/09/unix-one-liner-to-kill-han... Some interesting comments on that post too, which go into slightly deeper details.