Linux head command

If you wish to view the topmost of a large text file you can use the Linux head command. It is a handy command that will save you time and can automate your searching and reading and can make your life easier. In this article, we will cover the basic usage of the Linux head command.

Using head to view the first 10 rows of text file

head myTextFile.txt

Using head to view the first 100 lines

head -100 myTextFile.txt

You can use head and tail to view the exact lines of your file.

Using head to view lines 50-60 from a file that’s 100 lines:

tail -50 myTextFile.txt | head -10
  • 0 A felhasználók hasznosnak találták ezt
Hasznosnak találta ezt a választ?

Kapcsolódó cikkek

Linux tar Command

The Linux tar command is used to compress and extract files to and from an archive. In this...

Linux file command

The file command is used to check a file’s type and contents in Linux environment. It is most...

Linux export command

When you’re managing your shell’s variables and you wish to save them to your environment you can...

Linux su command

The su command is most commonly used to switch to another user. You will then be able to run...

Linux wc command

If you’re interested in finding the word count or lines of a file in your Linux environment you...

Powered by WHMCompleteSolution