码迷,mamicode.com
首页 > 其他好文 > 详细

21.head命令

时间:2019-01-13 02:05:32      阅读:175      评论:0      收藏:0      [点我收藏+]

标签:实例   pre   命令   scripts   文件头部   script   directory   etc   开头   

head命令用于显示文件的开头的内容。在默认情况下,head命令显示文件的头10行内容。

选项:
-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-*-

21.head命令

标签:实例   pre   命令   scripts   文件头部   script   directory   etc   开头   

原文地址:http://blog.51cto.com/itxuezhe/2342068

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!