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
    Metro Boston
    Beans
    11,496
    Distro
    Kubuntu 14.04 Trusty Tahr

    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,615
    Distro
    Xubuntu 14.04 Trusty Tahr

    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).
    Dell XP 8700 - Windows 10 64-bit Fast Ring - i7 4790 8GB 1GB 250GB SSD 1TB HDD
    HP Stream 13 - elementary Loki 64-bit
    HP Envy M6 - Windows 10 64-bit

  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
  •