I would avoid Kill -9 as the first signal sent to a process. Recommend kill HUP and TERM first since there's a chance the process could clean up before exiting. Kill -9 never cleans up so should be the last resort
TERM is the correct way. HUP often means reload stuff in "modern" software on Unix systems. TERM allows to listen to it and appropriately shut down, on Windows you can try SIGINT as many services and console applications typically listen to that
@@Kirides yeah, I would use TERM first. Did not know that HUP has been overloaded in modern software. I'm an olde phart and used UNIX back in the 80s when HUP really meant the modem had hung up 🙂
Does tmux require some extra config for this work or is it my setup that behaving weird? I'm getting the correct behaviour in my command line when not in a tmux session. ** and an fzf search opens. But then in tmux the same thing just auto completes to all the files in the current dir.
I have learned neat tricks from you, so here is mine, `pidof` you can do kill -9 `pidof puma` pidof gives you the pids of all the processes that match the named programs
Also, if you have 5 java running for example, killall is not what you want. Killall works if you actually want to kill all processes matching your query.
I have a different perspective. As much as reasonably possible, I prefer to rely on commonly-found utilities because it makes it easier to be productive on machines I haven’t personally configured. If I need to ssh into some random machine to troubleshoot an issue, I want things to feel as familiar as possible. I want to hit the ground running. Imagine that a coworker asks you for help with a problem on some server, and you look like you’re floundering around because you don’t know ps & kill. Or worse, if you insist on taking time to install some totally redundant utilities to perform basic tasks. It’s a bad look.
Great point, however one can also normally do a wget to a prepared file; sh for example without ever writing it to disk and put all the code “shortcuts”into temporary variable function; functions / aliases that’s wiped out after an exit (if it’s open to a source; internet or a local source too); that way one can do fast work with a light touch. Neat trick ⚡️🎩
Interesting! I just use pgrep -fa "word" and then onc'e I'm sure i'll only match what I want, I replace pgrep with pkill. If that's not enough I just launch htop/btop and use their search features.
I remember trying to kill a process on linux and it wouldn't kill it, because it was already dead. My teacher called them zombie processes and had to do something else to truly kill it.
Zombie process is a process that has terminated, but it's parent process did not pick up the exit status. The zombie entry in the process table will persist until the parent calls one of the wait* syscalls. Most often seeing a zombie process is an indication that the parent process is poorly programmed.
as a windows admin... this just seems like a bunch of fuxing about... taskkill /f /im done, no using other things, no fuxing about, no piping a query to another command. even if i used powershell to do it... this all seems like the most round about way to kill process. adding a bunch of stuff you dont need
Why I love Linux: Because even old terrible machines can make semi-usable machines. Why Iove windows: I can just CTRL+SHFT+DLT and look for the process using a UI originally designed 20 years ago, right click, and end process. Something I can tell my grandma to do over the phone while only using a PC for 4 hours a week for experience. The fact that everything I want to do in Linux requires a google search is the reason I don't use it.
The more you use it, the easier things become to remember, also a lot of Desktop Environments have almost the same shortcuts as Windows, it's just basically familiarity with Windows that's it. If you used Linux for a while, it wouldn't be an issue
Your comparison is not apples to apples. What shown in video is either cmd tasklist and taskkil or powershells stop-process. And said task managers exist in linux and come pre installed with major desktop environments such as gnome and kde, which are as easy as windows one
"If you want yellow paint, you used to have to mix green and red paint together, but with this one easy trick you dont have to! Just go to the store and get yellow paint!" 🙄
Do you know how to disassemble a modern engine? Do you know how to check civil engineering plans for storm and sanitary slopes and grades? Do you know how to route plumbing through walls and foundations to ensure pipes don't clog for the next 30 years? All those things require far more thinking than "how did this group of people decide to phrase things in order for this sentence to work". Sometimes it's nice to have something that can be figured without 20 Google searches after spending 55 hours a week in 90°F weather.
I no longer run Linux on my home machines precisely BECAUSE I don’t want to think about it. I have plenty of other things to think about which are waaaaaaay more interesting & important to me. I HAVE THINGS TO DO.
pkill-f
Why go the hard way…
Neat, I need to give 'fzf' some consideration. Until then, I'd probably stick to 'pgrep' / 'pkill' for this specific use case.
pgrep ** would also start the fuzzy process so you don't even need the pid
Oh
Pkill combines this pretty helpfully
Yeah, at first I assumed he'd use pkill.
I would avoid Kill -9 as the first signal sent to a process. Recommend kill HUP and TERM first since there's a chance the process could clean up before exiting. Kill -9 never cleans up so should be the last resort
TERM is the correct way. HUP often means reload stuff in "modern" software on Unix systems. TERM allows to listen to it and appropriately shut down, on Windows you can try SIGINT as many services and console applications typically listen to that
@@Kirides yeah, I would use TERM first. Did not know that HUP has been overloaded in modern software. I'm an olde phart and used UNIX back in the 80s when HUP really meant the modem had hung up 🙂
@@Kirides SIGTERM SIGHEIL
seems like htop+filter(f4 within htop)
My thought as well.
i love the album on your pfp
I prefer btop. Looks prettier, and filter is f, no reaching goofy places for f4. It's also the best fusion of a GUI and TUI I've ever seen.
Congratulations, you've just earned the Useless Use of Kill -9 Award.
Never knew this existed. Thanks for sharing! Super useful!!
pkill would do that just fine. Also try not to kill a process with -9 unless it was unresponsive.
What about killall? Fzf is nice, btw, thanks
As it says it kills "all", sometimes you wouldn't want that, you might be running multiple instances of the application
Wouldn't recommend. pkill, though.
With Fish you can do kill -9 then hit Shift + Tab which does much the same thing but without fzf.
Thanks man as a new linux user I was just searching how to do this in fish but now I don't need to set up fzf. Much appreciated :)
@@MrQuantumCodes cool. There is a plugin manager for fish called fisher. And there is a nice fish plugin for fzf.
Nice, been using CLI for years and understanding this is a gift, thank you nerd 👍
Does tmux require some extra config for this work or is it my setup that behaving weird? I'm getting the correct behaviour in my command line when not in a tmux session. ** and an fzf search opens. But then in tmux the same thing just auto completes to all the files in the current dir.
For once, a terminal tip that really speeds up my day. Thanks! I need to figure this out.
pgrep to list the id or pkill to kill the process
I have learned neat tricks from you, so here is mine, `pidof`
you can do kill -9 `pidof puma`
pidof gives you the pids of all the processes that match the named programs
Love it
wow that's a great one, didn't know fzf could do that 🤯
thanks for the fzf tip, why not use : killall puma ?
This just feels better to find an actual pid
Also, if you have 5 java running for example, killall is not what you want. Killall works if you actually want to kill all processes matching your query.
In Arch Linux, mine is crtl-q and it kills the process on the screen. I love it.
I absolutely love your nerd shorts. They’re brilliantly done
Using fish is way easier to find just write :
kill name+TAB
Wow I love your content ❤. This is so genius 🎉! Thank you so much for your great tips and all the terminal inspiration
fzf and jq are two tools that I need to learn. Those are awesome.
Thank you, steveMRE
I have a different perspective. As much as reasonably possible, I prefer to rely on commonly-found utilities because it makes it easier to be productive on machines I haven’t personally configured. If I need to ssh into some random machine to troubleshoot an issue, I want things to feel as familiar as possible. I want to hit the ground running.
Imagine that a coworker asks you for help with a problem on some server, and you look like you’re floundering around because you don’t know ps & kill. Or worse, if you insist on taking time to install some totally redundant utilities to perform basic tasks. It’s a bad look.
yeah, that is a great outlook
Great point, however one can also normally do a wget to a prepared file; sh for example without ever writing it to disk and put all the code “shortcuts”into temporary variable function; functions / aliases that’s wiped out after an exit (if it’s open to a source; internet or a local source too); that way one can do fast work with a light touch. Neat trick ⚡️🎩
Generally I use "kill -1" to terminate a process and only use "kill -9" if it is frozen or refusing to comply.
Why use fzf? The command killall does the exact same thing with no configuration needed.
tab completion just work
Do you have a video where you have shown how you have managed to customize your terminal so beautifully. Would love to learn it.
What keyboard setup do you have? It sounds amazing
very nice, did'nt know that i need this command, til i tried it
TIL, love this! Thanks, Nerd.
The programing Ted Lasso
hah, not the first time I've heard this
Interesting! I just use pgrep -fa "word" and then onc'e I'm sure i'll only match what I want, I replace pgrep with pkill.
If that's not enough I just launch htop/btop and use their search features.
another way: htop -> then start searching with "/puma" -> press
Pass 15 first, which allows process to attempt to shutdown gracefully. 15 is a polite request to stop, 9 is a grenade.
Man... I only use fzf with Ctrl+R ...this is amazing
I need you to kill this task.
Me: _Holds power button for 3 seconds_
I remember trying to kill a process on linux and it wouldn't kill it, because it was already dead. My teacher called them zombie processes and had to do something else to truly kill it.
Zombie process is a process that has terminated, but it's parent process did not pick up the exit status. The zombie entry in the process table will persist until the parent calls one of the wait* syscalls. Most often seeing a zombie process is an indication that the parent process is poorly programmed.
this is cool but in this example... just CTRL+Z and kill -9 %
or CTRL+C if you want the program to handle the signal
if process uses a port: sudo fuser -k PORT/tcp or sudo fuser -k PORT/udp
else: killall PROCESSNAME
killall: i am a joke to you?
you can also just do "killall name_of_process"
as a windows admin... this just seems like a bunch of fuxing about... taskkill /f /im done, no using other things, no fuxing about, no piping a query to another command. even if i used powershell to do it... this all seems like the most round about way to kill process. adding a bunch of stuff you dont need
You just blew my mind
Or you could just use killall -9 puma. Killing processes by name has been supported for decades. Fzf / zsh is still nice, though
I am using fzf on my Mac. In this case, can I utilize the same way?
yes
Why I love Linux: Because even old terrible machines can make semi-usable machines.
Why Iove windows: I can just CTRL+SHFT+DLT and look for the process using a UI originally designed 20 years ago, right click, and end process. Something I can tell my grandma to do over the phone while only using a PC for 4 hours a week for experience.
The fact that everything I want to do in Linux requires a google search is the reason I don't use it.
there are definitely easier ways to do this in linux btw
judt bind gnome process manager to ctrl+alt+delete. Same thing.
@@paultapping9510 Just do what? Here let me Google whatever that is real quick...
The more you use it, the easier things become to remember, also a lot of Desktop Environments have almost the same shortcuts as Windows, it's just basically familiarity with Windows that's it. If you used Linux for a while, it wouldn't be an issue
Your comparison is not apples to apples. What shown in video is either cmd tasklist and taskkil or powershells stop-process. And said task managers exist in linux and come pre installed with major desktop environments such as gnome and kde, which are as easy as windows one
pkill is your friend for that
Terrific
You are
@@typecraft_dev I know I am
How do you make your terminal look like that? The coloured line
You’re gonna make me use zsh now aren’t you 😮
Overengineering. Just `kill -9 $(pidof puma)` if you have only one puma process running, or just `ps + grep` in 2 seconds.
Which terminal mal emulated do you use
Ghostty
Is that Topre switch scratching my ears ? 😊
I usually do this, lsof -ti 3000 | xargs kill
I think kali use Zsh. This would be useful
I always do "killall node" to kill my react app which I forgot to close.
You can also just use killall
What dotfile do u use for the starship thing on ur terminal, yk the arrow thingy with the arch logo and the directory you're in
Are you using a hhkb?
sure am!
htop all the way baby
Helpful
Why not 'killall', as it does the same thing and it's a standard UNIX utility?
Id use pkill puma in this case
wow linux is so easy. kill the process easily by recompiling the kernel and add a package that lets you use a wildcard
So cool😮
What terminal emulator is that? Looks really pretty
If only a task manager existed
That’s about as fast as using htop. I might actually switch
fzf is slowly replcing every tool for me
killall puma also works ...
i just do “killall puma”
Not sure if it’s problematic tho
oooh what zsh theme is that??
or use ps -a, pipe to sed, pipe to xargs kill -9
"If you want yellow paint, you used to have to mix green and red paint together, but with this one easy trick you dont have to! Just go to the store and get yellow paint!" 🙄
what zsh theme is that?
It’s starship!
How do I get my terminal prompt to look like that?
Gives a 5 step solution to kill a process .. then gives a 7 step process to kill a process... Thanks
Thanks... Nerd
fzf-tab with oh-my-zsh and you won´t have to add the **
God Linux is so beautiful. You get to compute but still have to think. Mac/PC has killed the human brain but Linux gives me hope.
Do you know how to disassemble a modern engine? Do you know how to check civil engineering plans for storm and sanitary slopes and grades? Do you know how to route plumbing through walls and foundations to ensure pipes don't clog for the next 30 years? All those things require far more thinking than "how did this group of people decide to phrase things in order for this sentence to work".
Sometimes it's nice to have something that can be figured without 20 Google searches after spending 55 hours a week in 90°F weather.
@@thelazarous ever heard of having hobbies, you bore
I no longer run Linux on my home machines precisely BECAUSE I don’t want to think about it. I have plenty of other things to think about which are waaaaaaay more interesting & important to me. I HAVE THINGS TO DO.
killall ?
i can do that in fzy simple and awesome
ee... killall puma? xD
kill -9 shouldn’t be used unless you absolutely have to
Killall works for me
Nice!
btw i use btop to kill process
warning: killall exists
Ever heard of pkill? :)
I use htop
can we use killall 'process name'?
On windows i just click a mouse 2 times
What shell/terminal is that?
someone remembers xkill????
Yeah, but i still prefer good old killall
which terminal is this ?
Blimey it's just like MSDOS in 1993
htop, man
While fzf is cool, why not use pkill?
pkill puma, should also work?