<p>I got a text file  with a couple of lines and I am looking for a string in this file. I need to pass following command line parameters to the program:<br>
- file path<br>
- the string I am looking for<br>
- maximum number of processes the program is allowed to "fork" in order to complete this task.  </p>

<p>How to such a program should be constructed?</p>

A couple of thoughts.
You will have to open the file separately from each process, otherwise they will share a single file descriptor and thus have a shared position in the file (or not, see the comments, as this may be system specific...).
You may not see the speed increase you are hoping for due to disk access and/or cache miss patterns.
You might be able to beat both issues by memory mapping the file (well you still risk an increased cache miss rate)...
How badly do you need this? It runs a real risk of being premature optimization. I would recommend against touching the problem without a compelling need. Really.