|Sandeep said: (May 20, 2013)|
|Even we can use cat (along with head) to display top of the file.
E.g. cat filename | head -1
Or this is achieved with "sed" command (which is powerful text editor).
E.g. sed -n '1p' filename
sed '1q' filename
|Arnab Pathak said: (Jan 15, 2015)|
|Actually if head is used without any numbers by default it shows exactly top 10 lines of a file.|
|Kamal Verma said: (May 8, 2017)|
|The Head command display top 10 lines from the file.
$ head file.text
It will display top 10 lines of file.text.
Its opposite is tail command is display below 10 line of file.
Options are used with this as line count.
$head -3 file.txt
Display to three line of file.
Post your comments here:
Email : (optional)
» Your comments will be displayed only after manual approval.