• TrumpetX
    link
    fedilink
    English
    arrow-up
    2
    ·
    4 days ago

    I use awk instead of cut cause I can remember the syntax better.

    ps aux | grep zoom | grep -v grep | awk ‘{print $2}’ | xargs kill -9

    • stewie410
      link
      fedilink
      arrow-up
      2
      ·
      4 days ago

      You can get rid of those greps, btw:

      ps aux | awk '/zoom/ && $0 !~ /awk/ {print $2}'
      

      Or just use pgrep.

      • Victor@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        4 days ago

        The greps were much more legible that this concoction 😅

        But I second the use of pgrep. 👌

        Better yet, just killall zoom.

      • TrumpetX
        link
        fedilink
        English
        arrow-up
        1
        ·
        3 days ago

        The thing with killall is I can’t see what it’s going to do first. With the greps, I can look first, kill second.