Head command on Linux (see file start) [Basic Guide]

The head command in Linux is used to view the opening lines of a file. It’s the opposite of the tail command.

Suppose you only want to read the first few lines of a file. The head command shows the first 10 lines from the start of a file by default.

The frequently used option is:

-n number: Configures the number of lines that the head will show.

Example:

$ head —n 50 LEIAME.TXT

Uirá Endy Ribeiro

Uirá Endy Ribeiro is a Software Developer and Cloud Computing Architect with a 23-year career. He has master's degrees in computer science and fifteen IT certifications and is the author of 11 books recognized in the IT world market. He is also Director at Universidade Salgado de Oliveira and Director of the Linux Professional Institute - LPI Director's Board.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Need help?