Location Of Command

Hi There..
I want to execute history command in linux terminal by using execl() function.. but this function requires the complete path of command to be execute, so the problem is that I don't know the location of history command .. Any idea where is it ??
P.S : Even after google I'm unable to found the location
Thanks in advance
Hi Cire, Thanks for answering me ..
But this is not the answer to my question. I've to execute history command like the following.
execl("/bin/history","history", buf, (char*)0);
But unfortunately this line of code doesn't work.. it says command not found. But If I directly write history command in terminal it lists all the recent commands
I want the command to work like above..
Try this if bash is your shell:

1
2
3

execl( "/bin/bash", "history", buf, ( char * )0 );
Why not just read the .bash_history file?
Why not just read the .bash_history file?

I''ll be very thankfull to you If you tell me how to do that :)
Topic archived. No new replies allowed.