Killing process in Shell Script

后端 未结 7 2038
囚心锁ツ
囚心锁ツ 2021-02-09 05:04

I have a very simple problem: When I run a shell script I start a program which runs in an infinite loop. After a while I wanna stop then this program before I can it again with

7条回答
  •  我在风中等你
    2021-02-09 05:45

    you obtain the pid of app1 with

    ps ux | awk '/app1/ && !/awk/ {print $2}'
    

    and then you should be able to kill it....(however, if you've several instances of app1, you may kill'em all)

提交回复
热议问题