FREQUENTLY ASKED QUESTIONS (Linux)
Q: How to terminate or kill a process in linux? (Fedora,CentOS,Redhat)
First Identify the "process id" (pid) of the process to kill.
[root@server ~#]ps -e (display all the process in the system)
PID TTY TIME CMD
1 ? 00:00:00 init
2 ? 00:00:00 kthreadd
3 ? 00:00:00 migration/0
4 ? 00:00:00 ksoftirqd/0
5 ? 00:00:00 watchdog/0
6 ? 00:00:00 events/0
7 ? 00:00:00 cpuset
8 ? 00:00:00 khelper
9 ? 00:00:00 netns
10 ? 00:00:00 async/mgr
11 ? 00:00:00 pm
Note:Here the first column(PID) includes the process ids of all the running process.
How to find pid of a process by name
[root@server ~#]ps -e | grep <process name>
eg: [root@server ~#]ps -e | grep vsftpd
1719 ? 00:00:00 vsftpd (pid of vsftpd is 1719)
And KILL the process
[root@server ~#]skill -p <pid>
eg: [root@server ~#]skill -p 2152 (Kill the process with pid:2152)
Q: How to terminate or kill a process in linux? (Fedora,CentOS,Redhat)
First Identify the "process id" (pid) of the process to kill.
[root@server ~#]ps -e (display all the process in the system)
PID TTY TIME CMD
1 ? 00:00:00 init
2 ? 00:00:00 kthreadd
3 ? 00:00:00 migration/0
4 ? 00:00:00 ksoftirqd/0
5 ? 00:00:00 watchdog/0
6 ? 00:00:00 events/0
7 ? 00:00:00 cpuset
8 ? 00:00:00 khelper
9 ? 00:00:00 netns
10 ? 00:00:00 async/mgr
11 ? 00:00:00 pm
Note:Here the first column(PID) includes the process ids of all the running process.
How to find pid of a process by name
[root@server ~#]ps -e | grep <process name>
eg: [root@server ~#]ps -e | grep vsftpd
1719 ? 00:00:00 vsftpd (pid of vsftpd is 1719)
And KILL the process
[root@server ~#]skill -p <pid>
eg: [root@server ~#]skill -p 2152 (Kill the process with pid:2152)
0 comments:
Post a Comment