Login
Register
All Activity
Questions
Unanswered
Tags
Users
Ask a Question
About Us
986
Questions
785
Answers
Interview Preparation mode
beta
Funny Facebook Status
Enter your email address
All categories
SQL Server Interview Questions and Answers
(197)
SSIS Interview Questions and Answers
(54)
SSRS Interview Questions and Answers
(9)
SSAS Interview Questions and Answers
(29)
.NET Interview Questions and Answers
(186)
Oracle Interview Questions and Answers
(122)
Java Interview Questions and Answers
(32)
UNIX Interview Questions and Answers
(47)
Networking Interview Questions and Answers
(17)
MySQL Interview Questions and Answers
(30)
HR Interview Questions and Answers
(237)
General Interview Questions and Answers
(9)
Other Interview Questions and Answers
(8)
Job Openings
(3)
Greenplum Database Interview Questions and Answers
(5)
Explain about Killing a process in UNIX
Nice?
Vote!
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
kill
process
1 Answer
Nice?
Vote!
kill (terminate or signal a process)
It is sometimes necessary to kill a process (for example, when an executing program is in an infinite loop)
To kill a job running in the foreground, type ^C (control c). For example, run
% sleep 100
^C
To kill a suspended or background process, type
% kill %jobnumber
For example, run
% sleep 100 &
% jobs
If it is job number 4, type
% kill %4
To check whether this has worked, examine the job list again to see if the process has been removed.
ps (process status)
Alternatively, processes can be killed by finding their process numbers (PIDs) and using kill PID_number
% sleep 100 &
% ps
PID TT S TIME COMMAND
20077 pts/5 S 0:05 sleep 100
21563 pts/5 T 0:00 netscape
21873 pts/5 S 0:25 nedit
To kill off the process sleep 100, type
% kill 20077
and then type ps again to see if it has been removed from the list.
If a process refuses to be killed, uses the -9 option, i.e. type
% kill -9 20077
Note: It is not possible to kill off other users\' processes !!!
answered
1 year
ago
by
siva
(
10,720
points)
Related questions
Nice?
Vote!
1
answer
Explain about Listing suspended and background processes in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
file
process
Nice?
Vote!
1
answer
Explain about Processes and Jobs in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
file
process
job
Nice?
Vote!
1
answer
Explain about Searching the contents of a file in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
file
directory
Nice?
Vote!
1
answer
Explain about Displaying the contents of a file on the screen in UNIX
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
file
directory
Nice?
Vote!
1
answer
Explain about Pipes in UNIX?
asked
1 year
ago
in
UNIX Interview Questions and Answers
by
R
(
19,530
points)
unix-interview-question
unix
pipes