Head Command UNIX
Head command is use to print the number of lines specified with command from beginning of the file.
If number of lines are not mentioned with the command, then 10 lines from the beginning are displayed on terminal.
Following options can be used with the head command:
|-c, –bytes=[-]K||print the first K bytes of each file; with the leading ‘-‘, print all but the last K bytes of each file|
|-n, –lines=[-]K||print the first K lines instead of the first 10; with the leading ‘-‘, print all but the last K lines of each file|
|-q, –quiet, –silent||never print headers giving file names|
|-v, –verbose||always print headers giving file names|
|–help||display this help and exit|
|–version||output version information and exit|
Print 3 lines of file “CF0001.dat” on terminal.
$ head -3 CF0001.dat