Display the first part of a file with head

by
Ryan
on
October 14, 2008

Similar to the tail command which shows you the last few lines of a text file, the head command lets you to quickly view the first few lines.

The head command syntax.

head [options] file

By default head will show you the first 10 lines of a text file.

$ head textfile.txt

You can change the number of lines displayed by adding ‘-n‘ option and adding the number of lines.

$ head -n 3 textfile.txt

This will show the first 3 lines in the file.

No Comments
commands
, ,

No related posts.

Comments (0)

No comments yet

Trackbacks (0)

No trackbacks yet

Leave a Comment

(displayed with your post)
(will not be published)
(optional)
Copyright 2008-2010 WiredRevolution.com. All rights reserved.