Question: 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?

Answer: 
You probably don't need to use fork in day-to-day programming if you are writing applications.

Even if you do want your program to start another program to do some task, there are other simpler interfaces which use fork behind the scenes, such as "system" in C and perl.

For example, if you wanted your application to launch another program such as bc to do some calculation for you, you might use 'system' to run it. System does a 'fork' to create a new process, then an 'exec' to turn that process into bc. Once bc completes, system returns control to your program.

You can also run other programs asynchronously, but I can't remember how.

If you are writing servers, shells, viruses or operating systems, you are more likely to want to use fork.
`fork()` is used to spawn a child process. Typically it's used in similar sorts of situations as threading, but there are differences. Unlike threads, `fork()` creates whole seperate processes, which means that the child and the parent while they are direct copies of each other at the point that `fork()` is called, they are completely seperate, neither can access the other's memory space (without going to the normal troubles you go to access another program's memory).

`fork()` is still used by some server applications, mostly ones that run as root on a \*NIX machine that drop permissions before processing user requests. There are some other usecases still, but mostly people have moved to multithreading now.