Linux-admin-head-command
提供:Dev Guides
Linux Admin-headコマンド
headは、ファイル操作のどの部分で実行されるかに関して、tailの基本的な反対です。 デフォルトでは、 head はファイルの最初の10行を読み取ります。
*head* はtailと同様のオプションを提供します-
Switch | Action |
---|---|
-c | Output last denoted in kilobytes |
-n | Output n number of lines from eof |
-q | No headers only file content |
注-ファイルは下から追加されるため、Headは -f オプションを提供しません。
*head* は設定ファイルの説明を読むのに便利です。 このようなファイルを作成する場合、最初の10行を効果的に使用することをお勧めします。
[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]#