EXPLAIN: The GNU/Linux ‘Head’ Command.
November 28, 2005 by Jon
Filed under Explanation

I have frequently used the tail command, but wasn’t ware that there was a complimentary head command.
The head command will display the first n number of lines from a specified text file. For example, to view the first 10 lines of my /var/messages file, I can type:
head /var/messages
10 is the default, but if I wanted to view only the first 3 lines, I could type:
head -3 /var/messages
As with all GNU/Linux commands, there are a variety of switches to customize the behaviour of the head command. Consult the head manpage for full information.
















Yeah! Translated into Russian
How to print the text file start from x line (eg 3rd line) to y line (eg 10th line)
head -10 file.txt | tail -7