If there is an & following a program name, this program will be executed as a background process. You can use Unix command ps to take a look at the process status report:bg &
The ps command will generate some output similar to the above. At the beginning of each line, there is a number, the process ID, and the last item is a program name. If bg has been started successfully, you shall see a line with program name bg.3719 ... info ... program name 7156 ... info ... program name
To kill any process listed in the ps command's output, note its process ID, say 7156, then use the following
The program with process ID 7156 will be killed. If you use ps to inspect the process status output again, you will not see the process with process ID 7156.kill 7156
Note that any program you start with a command line is, by default, a foreground process. Thus, the following command starts fg as a foreground process:
fg
There is a short form to start both bg (in background) and fg (in foreground) at the same time:
bg & fg
With this technique, the server program can be started as a background process. After the message telling you to start the client, then start the client. The client can be background or a foreground process. In the following, the client is started as a foreground process:
server -4 2 6 -10 & client
Since the server and the client will display their output to the same window, you will see a mixed output. Or, you can start processes in different windows.
A list of shared memory segments will be shown. Then, use command ipcrm to remove those un-wanted ones:ipcs -m
where xxxx is the shared memory ID obtained from command ipcs. Note that without removing allocated shared memory segments you may jeopardize the whole system.ipcrm -m xxxx
Use man ipcs and man ipcrm to read more about these two commands.