用途

它是用来显示开头或结尾某个数量的文字区块

全称

head的全称即为head

参数

-q :隐藏文件名

-v :显示文件名

-c :<字节>显示字节数

-n :<行数>显示的行数

案例

案例一:显示文件/etc/man_db.conf 的前5行

[root@bigdata ~]# head -n 5 /etc/man_db.conf

#

#

# This file is used by the man-db package to configure the man and cat paths.

# It is also used to provide a manpath for those without one by examining

# their PATH environment variable. For details see the manpath(5) man page.

案例二:显示文件/etc/man_db.conf 除了最后5行所有的内容

[root@bigdata ~]# head -n -5 /etc/man_db.conf

#

#

# This file is used by the man-db package to configure the man and cat paths.

# It is also used to provide a manpath for those without one by examining

# their PATH environment variable. For details see the manpath(5) man page.

#

…..

案例三:显示文件/etc/man_db.conf 前100个字节

[root@bigdata ~]# head -c 100 /etc/man_db.conf

#

#

# This file is used by the man-db package to configure the man and cat paths.

案例二:显示文件/etc/man_db.conf 除了最后100个字节外所有的内容

[root@bigdata ~]# head -c -100 /etc/man_db.conf

#

#

# This file is used by the man-db package to configure the man and cat paths.

# It is also used to provide a manpath for those without one by examining

# their PATH environment variable. For details see the manpath(5) man page.

#

# Lines beginning with `#' are comments and are ignored. Any combination of

# tabs or spaces may be used as `whitespace' separators.

#

# There are three mappings allowed in this file:

……

【Linux】head命令的更多相关文章

  1. linux grep命令

    linux grep命令1.作用Linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来.grep全称是Global Regular Expressio ...

  2. Linux常用命令(一)

    Linux常用命令 1. pwd查看当前路径(Print Working Directory)    [root@CentOS ~]# pwd/root 2. cd .. 返回上一级 .. 表示上一级 ...

  3. Linux下命令行安装weblogic10.3.6

    Linux下命令行安装weblogic10.3.6 一.安装前准备工作: 1.创建用户useradd weblogic;创建用户成功linux系统会自动创建一个和用户名相同的分组,并将该用户分到改组中 ...

  4. Linux paste命令

    Linux paste命令用于合并文件的列. paste指令会把每个文件以列对列的方式,一列列地加以合并. 语法 paste [-s][-d <间隔字符>][--help][--versi ...

  5. 20145222《信息安全系统设计基础》Linux常用命令汇总

    学习Linux时常用命令汇总 通过Ctrl+f键可在该网页搜索到你想要的命令. Linux中命令格式为:command [options] [arguments] //中括号代表是可选的,即有些命令不 ...

  6. Linux sudo 命令的应用

    .note-content { font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", STHeit ...

  7. linux 基础命令与文件管理

      Linux终端介绍 Shell提示符 Bash Shell基本语法 基本命令的使用:ls.pwd.cd 查看系统和BIOS硬件时间 Linux如何获得帮助 Linux关机命令:shutdow.in ...

  8. linux awk命令详解

    linux awk命令详解 简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分 ...

  9. linux常用命令的介绍

    本文主要介绍Linux常用命令工具,比如用户创建,删除,文件管理,常见的网络命令等 如何创建账号: 1. 创建用户 useradd -m username -m 表示会在/home 路径下添加创建用户 ...

  10. Linux查找命令:grep,awk,sed

    grep grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来)是一种强大的文本搜索工具 ...

随机推荐

  1. java23种设计模式之一: 单例模式(Singleton Pattern)

    单例模式(Singleton Pattern)是设计模式中比较常用的一种,下面来总结单例模式的知识,包括: 1.理解什么是单例模式.单例模式有什么优点/缺点.单例模式的应用场景: 2.再来看看Java ...

  2. bzoj4753 最佳团体

    题目描述 JSOI 信息学代表队一共有 NN 名候选人,这些候选人从 11 到 NN 编号.方便起见,JYY 的编号是 00 号.每个候选人都由一位编号比他小的候选人R_iRi​ 推荐.如果 R_i ...

  3. [转]怎么把一个textview的背景图片设置成圆角的?

        在drawable文件夹下新建一个文件设置背景样式代码:在drawable文件夹下面新建text_view_border.xml<?xml version="1.0" ...

  4. bzoj 1789: [Ahoi2008]Necklace Y型项链 贪心

    1789: [Ahoi2008]Necklace Y型项链 Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://www.lydsy.com/Jud ...

  5. http://www.tangible-engineering.com/tangible_t4editor.html

    T4 Template Tutorials   http://www.tangible-engineering.com/tangible_t4editor.html

  6. 支持Tasker控制的app合集

    跟各种Tasker插件打交道,原因有两点: 1.站在开发者的角度:Tasker虽为神器,也不能面面俱到,一个原因就是Android自身过于分裂化造成的,不可能兼顾全平台和机型:个人开发者精力有限,也满 ...

  7. LM27313 (ACTIVE) 具有 30V 内部 FET 开关(采用 SOT-23 封装)的 1.6 MHz 升压转换器

    The LM27313 switching regulator is a current-mode boost converter with a fixed operating frequency o ...

  8. 水平ListView

    /* * HorizontalListView.java v1.5 * * * The MIT License * Copyright (c) 2011 Paul Soucy (paul@dev-sm ...

  9. js数组的使用

    1.创建: var arr=Array(); 2.遍历: for(var arg in arr){ alert(arr[arg]); } 3.追加 arr1.concat(arr2) 4.元素删除 d ...

  10. DTO的一些理解(转载)

    1.什么是DTO DTO(Data Tansfer Object)即数据传输对象.之前不明白有些框架中为什么要专门定义DTO来绑定表现层中的数据,为什么不能直接用实体模型呢,有了DTO同时还要维护DT ...