How to display only first few several lines from file Linux UNIX command

RegisterLogin
How to display only first few several lines from file Linux UNIX command
Post Description: How to display only first few several lines from file Linux UNIX command
Tags: How, to, display, only, first, few, several, lines, from, , file, Linux, UNIX, command
This Post Was Posted On Feb 29, 2008 By tomas #2113
ok, so lets say i have a file called users.txt and its a pretty big file, and i don't want to display all the conents because its too much information.

well, linux has a cool command you can use to only display a number of lines that you want to.

for example, lets say i only want to display or show the first ten lines of the users.txt file, to do that i will us this command

head users.txt

the head command reads the first then lines. in this came, the file users.txt. you can pass a number as an agument to the head command to speficy the number of lines to read and display it on your screen.

let say i only want to show the first six lines, then i would use this command

head -6 users.txt
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
thankyou
#2199 1
thanks, this was very helpful
Dec 31, 1969 Reply Report abuse
gian
#2200 2
thanks, this was very helpul for my service.
Dec 31, 1969 Reply Report abuse
©2011 Webune Forums - Wed Dec 21, 2011 3:12 am
Powered by: Webune Forums V3