alternative for head command

Hi friends,I am new to unix and this is really a dummy question.but please help me out.

       How to simulate head command without using head command???
       also tail command too,also more command.

it is given as a homework to do....please tell me how to do

Why do you want to do that, 'cause it surely sounds like homework.
As for head one of these should work (for the top 2 lines)

$ awk 'NR<=2' file
$ sed -ne '1,2p' file

Posting homework is against the rules.
Thread closed.