How To Display Only First Few Several Lines From File Linux UNIX Command
- Forums
- Linux Systems
- 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 [2893], Last Updated: Sat May 18, 2024
tomas
Sun Feb 25, 2007
2 Comments
1312 Visits
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