EXPLAIN: The GNU/Linux ‘Head’ Command.

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.
Related Stories
POSTED IN: Explanation
5 opinions for EXPLAIN: The GNU/Linux ‘Head’ Command.
New Linux User » EXPLAIN: The GNU/Linux ‘Tail’ Command.
Nov 28, 2005 at 7:49 am
[…] Much like the head command will display the top n number of lines of a specified file, the tail command will display the bottom n number of lines from a specified file. For example, to see the last 10 lines of my /var/messages file, I can type: tail /var/messages […]
AboutDigital.ru » EXPLAIN: Команда GNU/Linux ‘Head’
Dec 11, 2005 at 1:03 am
[…] Оригинальный текст статьи […]
Jon
Dec 11, 2005 at 9:47 am
Yeah! Translated into Russian :)
EXPLAIN: Команда GNU/Linux ‘Head’ at AboutDigital
Mar 17, 2006 at 6:29 am
[…] Оригинальный текст статьи […]
csp
Jun 19, 2007 at 2:05 am
How to print the text file start from x line (eg 3rd line) to y line (eg 10th line)
Have an opinion? Leave a comment: