top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to run a process in background and how to bring that into foreground and then how to kill that process?

+2 votes
334 views
How to run a process in background and how to bring that into foreground and then how to kill that process?
posted Jun 16, 2014 by Aarati Mahajan

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

For running a process in background use "&" in command line. For bringing it back in foreground use command "fg jobid" and for getting job id you use command "jobs", for killing that process find PID and use kill -9 PID command. This is indeed a good Unix Command interview questions because many of programmer not familiar with background process in UNIX.

answer Jun 17, 2014 by Mohammad
Similar Questions
+6 votes

Is there any way to kill the process which went to uninterruptible sleep (D) state due of some reason without rebooting machine??

I observed one of the process went to D-state during performance runs. Now, not able to kill the process using pkill or kill commands? Finally, we have to reboot the Linux machine.

Can anyone helps me out for this situation?? I don't want to reboot the machine.

We can kill the Zombie (Z) process but not able to kill process which is in D-state.

+4 votes

So many times, we make foreground process to background process in linux system. How does it handle internally ?

...