Head Command: Head (head) command displays first ten lines of a file. Example: head /etc/passwd
It can also display any other number of lines as per your need by writing the number of lines with command as shown in the following example. Example: head -5 /etc/passwd
Tail Command: Similar to head but as clear by its name it displays last ten lines of any file.
Here also you can give the number of lines you want to see as show below:
tail -6 file.txt