head Command in Linux: Display the First Lines of a File
Linuxcommands
The head command in Linux is used to view the initial lines of a file. It is the opposite of the tail command.
Suppose you want to read only the first lines of a file. The head command (from English header) displays the first 10 lines from the beginning of a file by default.
The frequently used option is:
-n number: Sets the number of lines that head will display.
Example:
$ head –n 50 LEIAME.TXT
Learn much more about Linux in our online course. You can enroll here. If you already have an account, or want to create one, just log in or create your user here.
Liked it? Share
That was just one piece. The course teaches the whole path — from your first command to exam day.