Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
is there a keystroke that will kill the current apps that running in the console (its not [Ctrl-C], because other apps can override it) is there one that other apps ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    139

    how to kill the current app thats running


    is there a keystroke that will kill the current apps that running in the console (its not [Ctrl-C], because other apps can override it) is there one that other apps *cant* override???

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    There's no keystroke that sends the KILL signal, but Ctrl+\ sends QUIT, which program more seldomly override, and Ctrl+Z puts the current job in the background. After having put it in the background, you can run "jobs -l" to find out its PID and then kill it manually with a kill signal.

  3. #3
    Linux User
    Join Date
    Jul 2004
    Location
    USA, Michigan, Detroit
    Posts
    329
    First you have to find the pid for the running proccess.
    You do this with this command from either a terminal window in the GUI or at the prompt in a true terminal.

    Use this one in a terminal window as you can scroll up and down.
    Code:
    linux:/ # ps -aux
    If you are in a true terminal you will need to pipe the out put to another program i.e. less so you can search it.
    Code:
    linux:/ # ps -aux | less
    You will get output like this.
    Code:
    linux:/ # ps -aux
    Warning: bad syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
    USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
    root         1  0.0  0.0   588  240 ?        S    Nov08   0:05 init [5]
    root         2  0.0  0.0     0    0 ?        SN   Nov08   0:00 [ksoftirqd/0]
    root         3  0.0  0.0     0    0 ?        S<   Nov08   0&#58;00 &#91;events/0&#93;
    root         4  0.0  0.0     0    0 ?        S<   Nov08   0&#58;00 &#91;kblockd/0&#93;
    root        26  0.0  0.0     0    0 ?        S    Nov08   0&#58;00 &#91;kapmd&#93;
    root        28  0.0  0.0     0    0 ?        S<   Nov08   0&#58;14 &#91;pdflush&#93;
    root        29  0.0  0.0     0    0 ?        S<   Nov08   0&#58;08 &#91;pdflush&#93;
    root        31  0.0  0.0     0    0 ?        S<   Nov08   0&#58;00 &#91;aio/0&#93;
    root        30  0.0  0.0     0    0 ?        S    Nov08   0&#58;11 &#91;kswapd0&#93;
    root       187  0.0  0.0     0    0 ?        S    Nov08   0&#58;00 &#91;kseriod&#93;
    In order to kill the process you must be the owner of the process or root and know pid all of which can be identified from the above information. Also before you kill a process you should make sur you know what that process is doing i.e. you would not kill init as that would be seriously detrimental to the system continuing to run.

    This is the command you would use to kill a certain process.
    Code:
    kill "pid #"
    If the command is stubborn and still won't die you can force it like this however if it won't die from the first one there maybe a good reason do some more research on the process before just resorting to forcing it.
    Code:
    kill -9 "pid #"
    Hope this helps
    Long live the revolution!
    Have a nice day.
    If you want real change vote Libertarian!

  4. #4
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    139
    okay, i got back to the command line, but how do i resume the suspended process???

  5. #5
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    If you mean a process that you suspended with Ctrl+Z, the shell command `fg' should get it back for you. You can have several suspended processes at the same time -- use the `jobs' command to list them. The `bg' and `fg' commands can make them run in the foreground/background (only one can run in the foreground, of course), and kill can kill any of them.

  6. #6
    Just Joined!
    Join Date
    Nov 2004
    Location
    Louisiana
    Posts
    2

    Re: how to kill the current app thats running

    Quote Originally Posted by user222
    is there a keystroke that will kill the current apps that running in the console (its not [Ctrl-C], because other apps can override it) is there one that other apps *cant* override???
    Here is another way to aquirer the PID of a runaway process and successfully kill it using the pipe and grep commands.

    First query the stale "xine" process in a xterm.
    Code:
    &#91;jon@raptor jon&#93;$ ps -elf | grep xine
    Your output should echo back with something similar to this.
    Code:
    5 S root       894     1  0  78   0    -   530 schedu Nov18 ?        00&#58;00&#58;00 xinetd -stayalive -reuse -pidfile /var/run/xinetd.pid
    0 S jon      13753  1360  1  75   0    - 45950 schedu 13&#58;36 pts/2    00&#58;00&#58;00 xine
    0 S jon      13772 13721  0  75   0    -   892 pipe_w 13&#58;37 pts/7    00&#58;00&#58;00 grep xine
    Notice how this instance only three processes were queried instead of a list running of processes. By using this technique should make it easier to locate the process that you are looking for.Once that you have identified the stale "xine" process you can then go ahead and kill the process in the same manner that "Copycon" performed.

  7. #7
    Linux User sheds's Avatar
    Join Date
    Nov 2004
    Location
    ??????????
    Posts
    342
    Here is how:

    1. <Ctrl><Alt><Esc>
    2. A skull-like mouse pointer appears.
    3. Click on the app you want to terminate.[/url]

  8. #8
    Linux User
    Join Date
    Jul 2004
    Location
    USA, Michigan, Detroit
    Posts
    329
    The problem with using Ctrl+Alt+Esc is that sometimes that does not actually kill the process it sometimes only kills the window the process is using leaving the stalled process running in the background using resources.
    Long live the revolution!
    Have a nice day.
    If you want real change vote Libertarian!

  9. #9
    Linux User sheds's Avatar
    Join Date
    Nov 2004
    Location
    ??????????
    Posts
    342
    Yeah, someone wrote exactly that too. I read that the right way to do it is with $kill PID, on a terminal. I tested it and i works, typing top to find out which apps are running.

  10. #10
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    139
    Quote Originally Posted by Dolda2000
    There's no keystroke that sends the KILL signal, but Ctrl+\ sends QUIT, which program more seldomly override, and Ctrl+Z puts the current job in the background. After having put it in the background, you can run "jobs -l" to find out its PID and then kill it manually with a kill signal.
    [Ctrl-Z] can still be overriden by other apps, for example, "twin"; "ytree" and "setedit"

Page 1 of 2 1 2 LastLast

Posting Permissions

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