选项:
-n<数字>:指定显示头部内容的行数;
-c<字符数>:指定显示头部内容的字符数;
-v:总是显示文件名的头信息;
-q:不显示文件名的头信息。
实例:
显示头部的5行内容
[root@localhost tmp]# head -n 5 functions
# -*-Shell-script-*-
#
# functions This file contains functions to be used by most or all
# shell scripts in the /etc/init.d directory.
#
显示functions文件头部的前20个字符
[root@localhost tmp]# head -c 20 functions
# -*-Shell-script-*-
原文:http://blog.51cto.com/itxuezhe/2342068