Results 1 to 5 of 5

Thread: Looking for code to kill a process

  1. #1
    Join Date
    Mar 2011
    Location
    Australia generally
    Beans
    225
    Distro
    Ubuntu Studio

    Looking for code to kill a process

    G'Day; I've been looking for a line of code which shows all running programs in the terminal and allows you to kill one by using the number on the left, I think it starts with "cp".
    Regards Miykel

  2. #2
    Join Date
    Oct 2005
    Location
    Lab, Slovakia
    Beans
    10,790

    Re: Looking for some code

    top
    htop

  3. #3
    Join Date
    Nov 2009
    Location
    Australia
    Beans
    57
    Distro
    Ubuntu

    Re: Looking for code to kill a process

    To list all processes, their 'pid' and their owners ...
    Code:
    ps -eaf
    To kill one of your processes ...
    Code:
    kill -9 'pid'
    To kill processes not owned by you ...
    Code:
    sudo kill -9 'pid'

  4. #4
    Join Date
    Jul 2010
    Location
    Bangalore, India
    Beans
    147
    Distro
    Ubuntu Development Release

    Re: Looking for code to kill a process

    Another method...

    ps -e | grep <name of the process>
    sudo killall <name of the process>

    if the first command does not return anything then you don't have that process running, hence no need to kill it.

    if it does not works..... then

    sudo kill -9 pid

    is the best alternate
    A stopped clock shows right time twice a day

  5. #5
    Join Date
    Mar 2011
    Location
    Australia generally
    Beans
    225
    Distro
    Ubuntu Studio

    Re: Looking for code to kill a process

    Thanks once again guys; told you it started with cp..........not...........lol.

    Many Thanks Miykel

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
  •