Find the answer to your Linux question:
Results 1 to 3 of 3
I have a FIFO file I'm reading in a background loop: Code: while (true) ; do cat </tmp/ui-output ; done & I close the terminal, open another one, run this ...
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Posts
    27

    How to kill background jobs? (kill %1 doesn't work)

    I have a FIFO file I'm reading in a background loop:
    Code:
    while (true) ; do cat </tmp/ui-output ; done &
    I close the terminal, open another one, run this line again. After a while a have several 'cat /tmp/ui-output' processes running. Now I want to clean up the mess. When I run jobs in a new terminal it shows nothing. When I'm trying to kill by PID the processes are getting re-spawned:
    Code:
    $ ps -o pid= -C 'cat /tmp/ui-output' 
    29773
    29774
    29775
    29776
    
    $ ps -o pid= -C 'cat /tmp/ui-output' | xargs kill
    
    $ ps -o pid= -C 'cat /tmp/ui-output' 
    29783
    29785
    29787
    29788
    How do I catch them?
    Thanks.

  2. #2
    Just Joined!
    Join Date
    Nov 2008
    Location
    PUNE
    Posts
    72
    Hi

    Try this

    Code:
    top
    It will give you list of the list of programs running on your system with pid and command (program name)

    the select the program you want to kill note down its pid
    then pass this command
    Code:
    kill -9 pid
    hope this will help

  3. #3
    Just Joined!
    Join Date
    Oct 2006
    Posts
    27
    Thanks. I forgot kill sends TERM signal by default while I needed KILL.

Posting Permissions

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