The main difference between execlp and execl is that in execlp we don't need to provide the pathname to look for, rather we provide it with the filename and rest is taken care by the function. An example where execlp can be preferred is : suppose we know the name of the utility but don't know its path, we can specify it in execlp and get the desired result for e.g. suppose we need to look for the utility cat, in execl we need to specify the exact path i.e. execl("/bin/cat","cat",(char*)0) whereas in execlp, we specify it as execlp("cat","cat",(char*)0).