I’m trying to make an application that checks if this specific application is running, then kill the app after a specified amount of time. I’m planning to get the pid of the app. How can I get the pid of the app?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You might try
ps -aux | grep foobarfor getting the pid, then issuing thekillcommand against it, alternatively you might want to usepkillfoobar, in both casesfoobarbeing the name of the app you want to terminate.