How To Display Only First Few Several Lines From File Linux UNIX Command
this post will show you how you can display the starting of a file at the begining or the start letters
how, to, display, only, first, few, several, lines, from, file, linux, unix, command
How To Display Only First Few Several Lines From File Linux UNIX Command
Post Description: this post will show you how you can display the starting of a file at the begining or the start letters
POST# 947
Posted On: Fri Feb 29, 2008 12:01 pm
tomas
Topic: How To Display Only First Few Several Lines From File Linux UNIX Command
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


Wed Dec 31, 1969 4:33 pm
1
thankyou
Reply #1683
thanks, this was very helpful
Wed Dec 31, 1969 4:33 pm
2
gian
Reply #1684
thanks, this was very helpul for my service.

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload