fbpx head Command in Linux: Display First Lines | Certificação Linux

head Command in Linux: Display the First Lines of a File

📅 01/01/2019 ⏱ 1 min ✍️ Uira Ribeiro
Linuxcommands
head Command in Linux: Display the First Lines of a File
Exam Pass App — mais de 7.000 questões LPI, offline, em 5 idiomas, disponível no Android e na App Store
Available on
Google Play
Available on
App Store

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

Uira Ribeiro

Prof. Uirá Ribeiro

Chair do Board do Linux Professional Institute

After years of watching professionals waste hours on simple tasks because they didn't know the right Linux tools, I decided to teach.
Today I'm the author of most of LPI's official Learning Materials and mentor to over 14,000 certified students.

See my full story →

That was just one piece. The course teaches the whole path — from your first command to exam day.

Certificação Linux — a plataforma líder em certificações Linux no Brasil
WhatsApp