b5media.com

Advertise with us

Enjoying this blog? Check out the rest of the Technology Channel Subscribe to this Feed

New Linux User

EXPLAIN: The GNU/Linux ‘Head’ Command.

by Jon on November 28th, 2005

Canadian Coin
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.

POSTED IN: Explanation

5 opinions for EXPLAIN: The GNU/Linux ‘Head’ Command.

Have an opinion? Leave a comment:




Check Spelling
Activate Spell Check while Typing