用途

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

全称

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. bzoj 2179: FFT快速傅立叶 -- FFT

    2179: FFT快速傅立叶 Time Limit: 10 Sec  Memory Limit: 259 MB Description 给出两个n位10进制整数x和y,你需要计算x*y. Input ...

  2. [转]Android:异步处理之AsyncTask的应用(二)

    2014-11-07     既然UI老人家都这么忙了,我们这些开发者肯定不能不识趣的去添乱阻塞UI线程什么的,否则UI界面万一停止响应了呢——这不是招骂的节奏么?!所以我们知道用Handler+Th ...

  3. Codeforces Round #305 (Div. 1) B. Mike and Feet 单调栈

    B. Mike and Feet Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/547/pro ...

  4. PAT甲级1103. Integer Factorization

    PAT甲级1103. Integer Factorization 题意: 正整数N的K-P分解是将N写入K个正整数的P次幂的和.你应该写一个程序来找到任何正整数N,K和P的N的K-P分解. 输入规格: ...

  5. IOS上传图片方法类

    IOS上传图片方法类   iPhone开发中遇到上传图片问题,找到多资料,最终封装了一个类,请大家指点,代码如下 // // RequestPostUploadHelper.h // demodes ...

  6. oracle定时任务(dbms_job)

    author:skate time:2007-09-12 http://publish.it168.com/2006/0311/20060311017002.shtml 今天总结下Oracle的任务队 ...

  7. 杭州有赞公司招聘 资深PHP开发工程师(平台架构方向)、技术专家

  8. .NET(C#)主流的ORM框架

    .NET(C#)主流ORM总揽 SqlSugar (国内) Dos.ORM (国内) Chloe (国内) StackExchange/Dapper (国外) Entity Framework (EF ...

  9. PHP:同一件事,有太多的方式

    背景 刚接触PHP,发现PHP做一件事有太多的方式,挺灵活的,这或许是PHP的一种设计哲学,也有可能是语言演化的结果,下面举几个例子. 几个例子 在web中嵌入PHP代码. <?php  ?&g ...

  10. Appium+python自动化55-appium desktop每次启动安装Unlock和Appium Setting问题

    前言 部分真机可能会出现每次运行代码,启动app之前都会重复安装Unlock和Appium Setting这两个小工具,有的手机会自动安装,这个还好. 有的手机每次都会弹出一个安装确认框(如部分小米和 ...