Linux commands you NEED TO KNOW. FZF and kill

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • X: / typecraft_dev
    learn: typecraft.dev
    This is how you kill a linux process, the easy way.

ความคิดเห็น • 210

  • @chrisbogausch1831
    @chrisbogausch1831 หลายเดือนก่อน +16

    pkill-f
    Why go the hard way…

  • @nihil14
    @nihil14 2 หลายเดือนก่อน +139

    Neat, I need to give 'fzf' some consideration. Until then, I'd probably stick to 'pgrep' / 'pkill' for this specific use case.

    • @Taddy_Mason
      @Taddy_Mason 2 หลายเดือนก่อน +5

      pgrep ** would also start the fuzzy process so you don't even need the pid

    • @hlubradio2318
      @hlubradio2318 2 หลายเดือนก่อน +1

      Oh

  • @Caminante-blanco
    @Caminante-blanco 2 หลายเดือนก่อน +73

    Pkill combines this pretty helpfully

    • @DaVyze
      @DaVyze หลายเดือนก่อน +8

      Yeah, at first I assumed he'd use pkill.

  • @ksbs2036
    @ksbs2036 2 หลายเดือนก่อน +58

    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

    • @Kirides
      @Kirides 2 หลายเดือนก่อน +10

      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

    • @ksbs2036
      @ksbs2036 2 หลายเดือนก่อน +3

      @@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 🙂

    • @Microphunktv-jb3kj
      @Microphunktv-jb3kj 2 หลายเดือนก่อน

      @@Kirides SIGTERM SIGHEIL

  • @akirafurude
    @akirafurude 2 หลายเดือนก่อน +37

    seems like htop+filter(f4 within htop)

    • @warcraftaddiction83
      @warcraftaddiction83 2 หลายเดือนก่อน

      My thought as well.

    • @user-jc1ci5ub6s
      @user-jc1ci5ub6s 2 หลายเดือนก่อน

      i love the album on your pfp

    • @mage3690
      @mage3690 14 วันที่ผ่านมา

      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.

  • @TheLukasz032
    @TheLukasz032 หลายเดือนก่อน +6

    Congratulations, you've just earned the Useless Use of Kill -9 Award.

  • @therealslimaddy
    @therealslimaddy 2 หลายเดือนก่อน +10

    Never knew this existed. Thanks for sharing! Super useful!!

  • @mhd8015
    @mhd8015 หลายเดือนก่อน +5

    pkill would do that just fine. Also try not to kill a process with -9 unless it was unresponsive.

  • @LuisCardozoC
    @LuisCardozoC 2 หลายเดือนก่อน +18

    What about killall? Fzf is nice, btw, thanks

    • @hashtag9990
      @hashtag9990 หลายเดือนก่อน +3

      As it says it kills "all", sometimes you wouldn't want that, you might be running multiple instances of the application

    • @patrickoberholzer4278
      @patrickoberholzer4278 21 วันที่ผ่านมา

      Wouldn't recommend. pkill, though.

  • @willadams6217
    @willadams6217 2 หลายเดือนก่อน +7

    With Fish you can do kill -9 then hit Shift + Tab which does much the same thing but without fzf.

    • @MrQuantumCodes
      @MrQuantumCodes 2 หลายเดือนก่อน +2

      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 :)

    • @willadams6217
      @willadams6217 2 หลายเดือนก่อน +1

      @@MrQuantumCodes cool. There is a plugin manager for fish called fisher. And there is a nice fish plugin for fzf.

  • @MiltonSanchez-bx8ne
    @MiltonSanchez-bx8ne 2 หลายเดือนก่อน +2

    Nice, been using CLI for years and understanding this is a gift, thank you nerd 👍

  • @yvescb
    @yvescb 2 หลายเดือนก่อน +2

    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.

  • @user-gh4lv2ub2j
    @user-gh4lv2ub2j 2 หลายเดือนก่อน +1

    For once, a terminal tip that really speeds up my day. Thanks! I need to figure this out.

  • @DelkorYT
    @DelkorYT 2 หลายเดือนก่อน +2

    pgrep to list the id or pkill to kill the process

  • @laughingvampire7555
    @laughingvampire7555 25 วันที่ผ่านมา +1

    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

  • @filipebraganca2558
    @filipebraganca2558 หลายเดือนก่อน +1

    wow that's a great one, didn't know fzf could do that 🤯

  • @scottb4029
    @scottb4029 2 หลายเดือนก่อน +8

    thanks for the fzf tip, why not use : killall puma ?

    • @typecraft_dev
      @typecraft_dev  2 หลายเดือนก่อน +1

      This just feels better to find an actual pid

    • @hesperauxyo
      @hesperauxyo 2 หลายเดือนก่อน +7

      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.

  • @askholia
    @askholia หลายเดือนก่อน +2

    In Arch Linux, mine is crtl-q and it kills the process on the screen. I love it.

  • @robertsimmons9563
    @robertsimmons9563 2 หลายเดือนก่อน

    I absolutely love your nerd shorts. They’re brilliantly done

  • @kabab-case
    @kabab-case 2 หลายเดือนก่อน +3

    Using fish is way easier to find just write :
    kill name+TAB

  • @LukasRotermund
    @LukasRotermund 2 หลายเดือนก่อน +1

    Wow I love your content ❤. This is so genius 🎉! Thank you so much for your great tips and all the terminal inspiration

  • @FilipeAguiarCarvalho
    @FilipeAguiarCarvalho 2 หลายเดือนก่อน

    fzf and jq are two tools that I need to learn. Those are awesome.

  • @matthewmorgan6814
    @matthewmorgan6814 2 หลายเดือนก่อน +1

    Thank you, steveMRE

  • @nw42
    @nw42 หลายเดือนก่อน +2

    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.

    • @typecraft_dev
      @typecraft_dev  หลายเดือนก่อน

      yeah, that is a great outlook

    • @kilianlindberg
      @kilianlindberg 10 วันที่ผ่านมา

      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 ⚡️🎩

  • @valkyri9245
    @valkyri9245 หลายเดือนก่อน

    Generally I use "kill -1" to terminate a process and only use "kill -9" if it is frozen or refusing to comply.

  • @aronhidvegi
    @aronhidvegi 2 หลายเดือนก่อน +1

    Why use fzf? The command killall does the exact same thing with no configuration needed.

  • @QuOUseTERSEa
    @QuOUseTERSEa 2 หลายเดือนก่อน +1

    tab completion just work

  • @aham.manishverma
    @aham.manishverma 2 หลายเดือนก่อน

    Do you have a video where you have shown how you have managed to customize your terminal so beautifully. Would love to learn it.

  • @jose.peraltabros
    @jose.peraltabros 2 หลายเดือนก่อน +1

    What keyboard setup do you have? It sounds amazing

  • @mrsuncure1259
    @mrsuncure1259 หลายเดือนก่อน

    very nice, did'nt know that i need this command, til i tried it

  • @rogertinsley3968
    @rogertinsley3968 2 หลายเดือนก่อน +1

    TIL, love this! Thanks, Nerd.

  • @hannahleah5875
    @hannahleah5875 29 วันที่ผ่านมา +3

    The programing Ted Lasso

    • @typecraft_dev
      @typecraft_dev  29 วันที่ผ่านมา

      hah, not the first time I've heard this

  • @unfa00
    @unfa00 หลายเดือนก่อน

    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.

  • @marcgrec5117
    @marcgrec5117 2 หลายเดือนก่อน

    another way: htop -> then start searching with "/puma" -> press

  • @ChrisCox-wv7oo
    @ChrisCox-wv7oo หลายเดือนก่อน

    Pass 15 first, which allows process to attempt to shutdown gracefully. 15 is a polite request to stop, 9 is a grenade.

  • @_dnL
    @_dnL หลายเดือนก่อน

    Man... I only use fzf with Ctrl+R ...this is amazing

  • @Zaddy_Woods
    @Zaddy_Woods 29 วันที่ผ่านมา +1

    I need you to kill this task.
    Me: _Holds power button for 3 seconds_

  • @DanishTroll87
    @DanishTroll87 2 หลายเดือนก่อน +1

    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.

    • @vrza
      @vrza 2 หลายเดือนก่อน +1

      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.

  • @Deeharok
    @Deeharok 2 หลายเดือนก่อน

    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

  • @VictorMartins239
    @VictorMartins239 20 วันที่ผ่านมา

    if process uses a port: sudo fuser -k PORT/tcp or sudo fuser -k PORT/udp
    else: killall PROCESSNAME

  • @vincent_sz
    @vincent_sz หลายเดือนก่อน +1

    killall: i am a joke to you?

  • @DevJeremi
    @DevJeremi 18 วันที่ผ่านมา

    you can also just do "killall name_of_process"

  • @adammiller9029
    @adammiller9029 หลายเดือนก่อน +1

    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

  • @chrisXr
    @chrisXr 2 หลายเดือนก่อน

    You just blew my mind

  • @andreaslaroi8956
    @andreaslaroi8956 2 หลายเดือนก่อน

    Or you could just use killall -9 puma. Killing processes by name has been supported for decades. Fzf / zsh is still nice, though

  • @WanyBae
    @WanyBae 2 หลายเดือนก่อน +3

    I am using fzf on my Mac. In this case, can I utilize the same way?

  • @thelazarous
    @thelazarous 2 หลายเดือนก่อน +14

    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.

    • @p0kepengin592
      @p0kepengin592 2 หลายเดือนก่อน

      there are definitely easier ways to do this in linux btw

    • @paultapping9510
      @paultapping9510 2 หลายเดือนก่อน

      judt bind gnome process manager to ctrl+alt+delete. Same thing.

    • @thelazarous
      @thelazarous 2 หลายเดือนก่อน

      @@paultapping9510 Just do what? Here let me Google whatever that is real quick...

    • @samuelsurfboard9887
      @samuelsurfboard9887 2 หลายเดือนก่อน

      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

    • @ky3ow
      @ky3ow 2 หลายเดือนก่อน +2

      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

  • @rira12621
    @rira12621 2 หลายเดือนก่อน +2

    pkill is your friend for that

  • @Laggedskapari
    @Laggedskapari 2 หลายเดือนก่อน +2

    Terrific

    • @typecraft_dev
      @typecraft_dev  2 หลายเดือนก่อน +1

      You are

    • @Laggedskapari
      @Laggedskapari 2 หลายเดือนก่อน

      @@typecraft_dev I know I am

  • @19furkan96
    @19furkan96 หลายเดือนก่อน

    How do you make your terminal look like that? The coloured line

  • @GregorMitchell
    @GregorMitchell 23 วันที่ผ่านมา

    You’re gonna make me use zsh now aren’t you 😮

  • @yoctoleef
    @yoctoleef 2 วันที่ผ่านมา

    Overengineering. Just `kill -9 $(pidof puma)` if you have only one puma process running, or just `ps + grep` in 2 seconds.

  • @quinnschubert6870
    @quinnschubert6870 20 วันที่ผ่านมา +1

    Which terminal mal emulated do you use

  • @foro1
    @foro1 หลายเดือนก่อน

    Is that Topre switch scratching my ears ? 😊

  • @santhoskumar1369
    @santhoskumar1369 หลายเดือนก่อน

    I usually do this, lsof -ti 3000 | xargs kill

  • @ravindrabhuva5029
    @ravindrabhuva5029 23 วันที่ผ่านมา

    I think kali use Zsh. This would be useful

  • @gireeshbhat4158
    @gireeshbhat4158 หลายเดือนก่อน

    I always do "killall node" to kill my react app which I forgot to close.

  • @bryophyta9500
    @bryophyta9500 19 วันที่ผ่านมา

    You can also just use killall

  • @claymorwan
    @claymorwan 2 หลายเดือนก่อน

    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

  • @alborn4217
    @alborn4217 2 หลายเดือนก่อน +1

    Are you using a hhkb?

  • @eswarrior
    @eswarrior 2 หลายเดือนก่อน

    htop all the way baby

  • @DR19X
    @DR19X 2 หลายเดือนก่อน +1

    Helpful

  • @giuseppedjtech6262
    @giuseppedjtech6262 14 วันที่ผ่านมา

    Why not 'killall', as it does the same thing and it's a standard UNIX utility?

  • @freibuis
    @freibuis 2 หลายเดือนก่อน

    Id use pkill puma in this case

  • @notquiteordinary
    @notquiteordinary 2 หลายเดือนก่อน +2

    wow linux is so easy. kill the process easily by recompiling the kernel and add a package that lets you use a wildcard

  • @mampiisaotaku
    @mampiisaotaku หลายเดือนก่อน

    So cool😮

  • @juraj_s
    @juraj_s 2 หลายเดือนก่อน

    What terminal emulator is that? Looks really pretty

  • @DJEntroP
    @DJEntroP 2 หลายเดือนก่อน

    If only a task manager existed

  • @VoyivodaFTW1
    @VoyivodaFTW1 หลายเดือนก่อน

    That’s about as fast as using htop. I might actually switch

  • @peterszarvas94
    @peterszarvas94 2 หลายเดือนก่อน +1

    fzf is slowly replcing every tool for me

  • @richardmeyer418
    @richardmeyer418 6 วันที่ผ่านมา

    killall puma also works ...

  • @prof.tahseen6104
    @prof.tahseen6104 2 หลายเดือนก่อน

    i just do “killall puma”
    Not sure if it’s problematic tho

  • @epsyl8812
    @epsyl8812 14 วันที่ผ่านมา

    oooh what zsh theme is that??

  • @thegreatbambino3358
    @thegreatbambino3358 11 วันที่ผ่านมา

    or use ps -a, pipe to sed, pipe to xargs kill -9

  • @thibauldnuyten2891
    @thibauldnuyten2891 2 หลายเดือนก่อน

    "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!" 🙄

  • @serghaouiyoussef962
    @serghaouiyoussef962 20 วันที่ผ่านมา +1

    what zsh theme is that?

    • @typecraft_dev
      @typecraft_dev  20 วันที่ผ่านมา +1

      It’s starship!

  • @johnyferreira8733
    @johnyferreira8733 2 หลายเดือนก่อน

    How do I get my terminal prompt to look like that?

  • @Tay-ky3fi
    @Tay-ky3fi 2 หลายเดือนก่อน +10

    Gives a 5 step solution to kill a process .. then gives a 7 step process to kill a process... Thanks

    • @pourradass
      @pourradass 2 หลายเดือนก่อน

      Thanks... Nerd

  • @rauluis
    @rauluis 10 วันที่ผ่านมา

    fzf-tab with oh-my-zsh and you won´t have to add the **

  • @BakersfieldBhakti
    @BakersfieldBhakti 2 หลายเดือนก่อน +2

    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.

    • @thelazarous
      @thelazarous 2 หลายเดือนก่อน +2

      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.

    • @p0kepengin592
      @p0kepengin592 2 หลายเดือนก่อน

      @@thelazarous ever heard of having hobbies, you bore

    • @nw42
      @nw42 หลายเดือนก่อน

      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.

  • @mohamedsamet4539
    @mohamedsamet4539 2 หลายเดือนก่อน +1

    killall ?

  • @kamalelbalaidi4914
    @kamalelbalaidi4914 2 หลายเดือนก่อน

    i can do that in fzy simple and awesome

  • @89Sawik
    @89Sawik 2 หลายเดือนก่อน +1

    ee... killall puma? xD

  • @serhiimamedov
    @serhiimamedov หลายเดือนก่อน

    kill -9 shouldn’t be used unless you absolutely have to

  • @user-ot9fy8ym4g
    @user-ot9fy8ym4g หลายเดือนก่อน

    Killall works for me

  • @AleksandarPopovic
    @AleksandarPopovic 2 หลายเดือนก่อน

    Nice!

  • @warmdev
    @warmdev 2 หลายเดือนก่อน

    btw i use btop to kill process

  • @karakami
    @karakami หลายเดือนก่อน

    warning: killall exists

  • @upliftshorts
    @upliftshorts 2 หลายเดือนก่อน

    Ever heard of pkill? :)

  • @MaryTheTankGirl
    @MaryTheTankGirl 2 หลายเดือนก่อน +1

    I use htop

  • @user-ys3yp2vi5t
    @user-ys3yp2vi5t 2 หลายเดือนก่อน

    can we use killall 'process name'?

  • @djohardudaev95
    @djohardudaev95 2 หลายเดือนก่อน

    On windows i just click a mouse 2 times

  • @pixiturf
    @pixiturf 2 หลายเดือนก่อน

    What shell/terminal is that?

  • @mariluskithings
    @mariluskithings 7 วันที่ผ่านมา

    someone remembers xkill????

  • @notcastey
    @notcastey 2 หลายเดือนก่อน

    Yeah, but i still prefer good old killall

  • @vohrameghank1158
    @vohrameghank1158 หลายเดือนก่อน

    which terminal is this ?

  • @p165711
    @p165711 13 วันที่ผ่านมา

    Blimey it's just like MSDOS in 1993

  • @blackheartedua
    @blackheartedua 2 หลายเดือนก่อน

    htop, man

  • @FabianKasper
    @FabianKasper 2 หลายเดือนก่อน

    While fzf is cool, why not use pkill?

  • @MantasJurkuvenas
    @MantasJurkuvenas 2 หลายเดือนก่อน

    pkill puma, should also work?