Linux Admin – head Command

  • Post author:
  • Post category:Linux
  • Post comments:0 Comments

The head is the basic opposite of the tail in relation to what part of the file operations are performed on. By default, the head will read the first 10 lines of a file.

The head offers similar options as tail −

SwitchAction
-cOutput last denoted in kilobytes
-nOutput n number of lines from eof
-qNo headers only file content

Note − Head offers no -f option since the files are appended from the bottom.

the head is useful for reading descriptions of configuration files. When making such a file, it is a good idea to use the first 10 lines effectively.

[root@centosLocal centos]# head /etc/sudoers

## Sudoers allows particular users to run various commands as

## the root user, without needing the root password.

##

## Examples are provided at the bottom of the file for collections

## of related commands, which can then be delegated out to particular

## users or groups.

## 

## This file must be edited with the ‘visudo’ command.

## Host Aliases

[root@centosLocal centos]#

Leave a Reply