5 ms·
After decades of experience I learned to use ctrl-\ (break) or ctrl-z and then kill -9 %1. Hope this helps someone.
by dmarinus 4y ago
After decades of experience I learned to use ctrl-\ (break) or ctrl-z and then kill -9 %1. Hope this helps someone.
- klez 4y agoWhich is exactly what the author is saying shouldn't be needed.
- dmarinus 4y agoAuthor is talking about looking up PIDs, kill -9 %1 saves you from that.
- kcl 4y agoIt is true this improves the bad path. It ignores desired happy path cases: downstream processes, custom debugging, graceful shutdown, preserved workspaces, and so on.
- kragen 4y agoIt may not be %1; if the shell says [2]+ Stopped units it's %2. But it's also %+, %%, and just %, which is what the "+" after the [2] means. In my case %1 is evince zhegalkin-sm7433.pdf (Running, not Stopped), which I definitely do not want to kill. Plenty of people open a new terminal window for every new program they want to run, but I commonly have several "jobs" in the same window, stopped or even running. Less often now that monitors are bigger, but still.
- dingdingdang 4y agoExcellent advice, thanks for sharing. Would in turn recommend using CopyQ to store this tips (and other like it) as a pinned items in folder with explanations for use two years later, that's how I personally stay on top of terminal kung-fu without overloading the consciousness-in-meat* * https://www.mit.edu/people/dpolicar/writing/prose/text/thinkingMeat.html https://www.mit.edu/people/dpolicar/writing/prose/text/think...
- drdec 4y agoI wouldn't call this excellent advice - kill -9 will rob the process of the opportunity to clean up after itself and leave everything in a good state (e.g. any binary files being manipulated by the application). So I would use this as a last resort - start with Ctrl+C and then "kill INT %1" and then "kill TERM %1" before "kill KILL %1". (For those who don't know "kill KILL" is equivalent to "kill -9". And despite the name "kill" is a tool for sending signals to processes.)
- dingdingdang 4y agoThanks for elaborating: the ctrl-c as first port of call was assumed obvious from my side but the: " "kill INT %1" and then "kill TERM %1" before "kill KILL %1". " is good advice as progressive measures
- awild 4y agoKill9 can keep ports locked for a bit after exiting which is a quite annoying
- M9HF8wwiaAdZKEZ 4y agoAnything can keep ports locked for a bit (if either side doesn't properly close the connection). That's how TCP works. Set reuseaddr on your daemon's sockets.