Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

bash question (possibly newbie'ish)

  • 08-11-2001 05:36PM
    #1
    Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭


    Ok I want to kill all wine processes in one go in a bash file.

    So something like ps -A | grep wine will list all the processes that need to be killed. The first column is the process ID's (would be $1 if command line).

    What's the syntax to actually kill all the processes? :( Been a while since I did this sort of thing. =/

    ps. I know kill -9 will kill the process, I'm looking for the bash syntax to drag the id's out.


Comments

  • Registered Users, Registered Users 2 Posts: 1,982 ✭✭✭ObeyGiant


    for i in `ps -A | grep wine | awk {'print $1'}`
    do
      kill -9 $i
    done
    

    Or 'killall wine'


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Cheers!


Advertisement