How can we run a process in background in Unix? How can we kill a process running in background?

In Unix shell we can use symbol & to run a command in background.

E.g. % ls –lrt &

Once we use & option it runs the process in background and prints the process ID. We cannot down this process ID for using it in kill command.

We can also use ps –ef command to get the process ID of processes running in background.

Once we know the process ID of a process we can kill it by following command:

% kill -9 processId

Leave a Reply

Your email address will not be published. Required fields are marked *