Is there any command which list out all the Daemon processes created by users to perform some tasks. I have created various daemon processes and I want to kill it manually by checking its pid how can I do that.
1 Answer
All running processes (daemon and otherwise) can be listed using ps aux, you can filter out the process using grep on its output as follows:
ps aux | grep <process_name>this would list its PID as well, which you can use to kill the process using:
kill <pid>For, example, when I execute:
ps aux | grep mysqldon my system, I get:
mysql 3933 0.0 1.2 418616 46832 ? Ssl 10:21 0:00 /usr/sbin/mysqldwhere 3933 is the pid, which I can kill using:
kill 3933(I required sudo here, since I am not the owner of the process)
Or if you know the exact process name and it has only one running instance or you want to kill all running instances, you could use:
killall <process_name>You could also use
pidof <process_name>to get just the pid of the concerned process, however, you need to know the exact process name.
2