Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

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 mysqld

on my system, I get:

mysql     3933  0.0  1.2 418616 46832 ?        Ssl  10:21   0:00 /usr/sbin/mysqld

where 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.

share|improve this answer
    
Yes but can i list out all the Daemon process created by user and created by server like the system generated daemon will have the ppid=1 but how to know the daemon which user has created. –  ali786 Jun 24 at 4:59
    
@ali786: I didn't get you, ps aux will list all processes by all users, if you just want the processes for a single user user, just do ps -U <username>. –  i08in Jun 24 at 5:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.