Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: kill processes with name=x && %mem>y

  1. #11
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: kill processes with name=x && %mem>y

    Just a note that you can kill a process by name, rather than PID, using "killall programname" instead of "kill". As the name implies, though, it kills all processes running programname, which may or may not be what you want to do.

    killall takes the same switches as kill; -15 is "graceful," while -9 lowers the boom.

  2. #12
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: kill processes with name=x && %mem>y

    Killing seems so brutal. Couldn't you just set their niceness so they run at low priority? Or is this some hog user on your system you want to rid yourself of?

    man renice
    Last edited by BkkBonanza; September 24th, 2010 at 05:47 AM.

  3. #13
    Join Date
    Jun 2007
    Location
    Oklahoma City, OK
    Beans
    200
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: kill processes with name=x && %mem>y

    Quote Originally Posted by SeijiSensei View Post
    Just a note that you can kill a process by name, rather than PID, using "killall programname" instead of "kill". As the name implies, though, it kills all processes running programname, which may or may not be what you want to do.

    killall takes the same switches as kill; -15 is "graceful," while -9 lowers the boom.
    I would not advise becoming accustomed to using `killall`, as it has drastically different behaviors on other *nix platforms.

    pkill is much preferred.
    Te audire no possum. Musa sapientum fixa est in aure.

  4. #14
    Join Date
    Sep 2005
    Beans
    1,596
    Distro
    Ubuntu Mate 20.04 Focal Fossa

    Re: kill processes with name=x && %mem>y

    Quote Originally Posted by LightningCrash View Post
    I would not advise becoming accustomed to using `killall`, as it has drastically different behaviors on other *nix platforms.

    pkill is much preferred.
    I haven't made scripts that do killall or kill, but I do use those quite a bit with stuck programs. Why pkill? (googling now).
    MBA M1 - M1 8GB 256GB - macOS Monterey
    MSI GL65 - i5-10300H 16GB 512GB GTX 1650 Windows 11
    Galaxy Book Go - Snapdragon 7c Gen 2 4GB 128GB Windows 11

  5. #15
    Join Date
    Jun 2007
    Location
    Oklahoma City, OK
    Beans
    200
    Distro
    Kubuntu 10.04 Lucid Lynx

    Re: kill processes with name=x && %mem>y

    Quote Originally Posted by slooksterpsv View Post
    I haven't made scripts that do killall or kill, but I do use those quite a bit with stuck programs. Why pkill? (googling now).
    If you're on a Solaris box and you type
    killall firefox
    It will kill everything on the machine. Solaris' killall doesn't accept processname arguments.
    Te audire no possum. Musa sapientum fixa est in aure.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •