Tuesday, December 17, 2013

Linux tips: run and kill process in background

To start a process and force it run in background, add the character '&' after the command:
$ [cmd] [args] &

To lists the jobs that you are running in the background, enter the command:
$ jobs

To kill a job running in background, using the kill command.

The video demo how it work on Raspberry Pi. A lxtask is open to monitor the running process. And two terminal are opened to run host (on right side) and client (on bottom-left). The host program is a long-running program. The client program send request to host. To know more about it, read the post "Java exercise - Client and Server example II, ServerSocket stay in loop". The video show how to run the host program in background.

No comments: