In many programs and man pages of Linux, I have seen code using fork(). Why do we need to use fork() and what is its purpose?
fork()
fork() will create a new child process identical to the parent. So everything you run in the code after that will be run by both processes — very useful if you have for instance a server, and you want to handle multiple requests.