head – show first lines of a text file
head command is a great Unix/Linux utility that is super useful when workig with text files. It shows you the top few lines of a specified file, but will also do the same with a redirected output of another Unix/Linux command.
Show the top 10 lines with head command
By default, you just need to specify the file you’re interested in. head will get the first top 10 lines from the file and show them in your console:
Show a specific number of lines with head command
You can specify the exact number of lines if you want. Really useful if you don’t need all 10 lines, for example:
See also
head command is a great Unix/Linux utility that is super useful when workig with text files. It shows you the top few lines of a specified file, but will also do the same with a redirected output of another Unix/Linux command.
Show the top 10 lines with head command
By default, you just need to specify the file you’re interested in. head will get the first top 10 lines from the file and show them in your console:
Show a specific number of lines with head command
You can specify the exact number of lines if you want. Really useful if you don’t need all 10 lines, for example: