My course is called operating systems and I have a HUGE project due at the end of the semester. But in order to get started on the right foot, I just wanted to get all my basics right. So here's some code that creates a process. How do I let the user create processes and then be able to terminate all process by a command (say terminate)?
If you are at the command-line, you can use ps command to get the pid and then do a kill -9 <pid> Wrap all those commands inside a terminate.sh and then all you need to do is terminate.sh to execute it.
Above uses the Unix scripting solution which btw is used very often by systems administrator as it is fast and does not require compilation of a C/C++ program to achieve the same objective.